Jump to content

[SOLVED] PEAR SMTP


papaface

Recommended Posts

Hello,

I am trying to send emails using pear, and i get this message:

Fatal error: Undefined class name 'mail' in register1.php on line 76

 

What does that mean? Please bare in mind in just learning how to send emails via pear.

This is my code:

$body = $email_content;

$headers = array ('From' => $activation_email_from,
  'To' => $submitted_email_address,
  'Subject' => $activation_email_subject,
  'MIME-Version' => "1.0\n",
  'Content-type' => "text/html;charset=iso-8859-1\n");
$smtp = Mail::factory('smtp', //line 76
  array ('host' => $_smtphostname,
	'auth' => true,
	'username' => $__getsmtpusername,
	'password' => $__getsmtppassword));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) 
	{
  echo "We have now registered you as a member, thank you for registering, your username is " . $submitted_username;
	echo '<br>However there was a problem with dispatching your activation email. Please contact the site admin.';
	} 
 else
	{
	echo "We have now registered you as a member, thank you for registering, your username is " . $submitted_username;
	echo '<br>We have dispatched an activation email to the address provided. You must click on the link in the email to activate your membership.';
	}

Am I doing this correctly?

Link to comment
https://forums.phpfreaks.com/topic/39030-solved-pear-smtp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.