Jump to content

HELP!!!Sending Mail With Standard PHP Mail via external SMTP Server


dklbwf

Recommended Posts

Hello PHP Family,

 

I am having some serious issues that i cannot figure out, i am using a script which i purchased and my site is supposed to send confirmation links once members register.  The script uses the basic php mail function but is not sending nothing out after members signup, not sure if maybe i need to put in smtp settins somewhere in the php file or whats going on.  I edited the file a little bit and i am getting error message:

 

 

Warning: mail() [function.mail]: SMTP server response: 513 5.0.0 Your email system must authenticate before sending mail. in D:\www\eazygirls4u\mail.php on line 24

 

Attached is mail file i am working with, also i am using authsmtp as my external smtp server.

 

Thanks N Advance for any help!!!

 

<?
$ntm3k_ncd_directive=$do_not_change;
send_html("[email protected]","[email protected]","test","test text","<h1>test html</h1>");
function send_html($from, $to, $subject, $text, $html)
{
global $debug;
if ($debug) echo "<HR>DEBUG|From:$from|To:$to|Subject:$subject<HR>$text<HR>$html<HR>";
$headers = "From: $from\r";
$headers .= "Reply-To: $from\r";
$headers .= "X-Mailer: PHP/" . phpversion()."\r";
$headers .= "MIME-Version: 1.0\r"; 
$boundary = uniqid("MAB"); 
$headers .= "Content-Type: multipart/alternative" . 
   "; boundary = $boundary\r\r"; 
$headers .= "$text\r\r"; 
$headers .= "--$boundary\r" . 
   "Content-Type: text/plain; charset=ISO-8859-1\r" . 
   "Content-Transfer-Encoding: base64\r\r"; 
$headers .= chunk_split(base64_encode("$text")); 
$headers .= "--$boundary\r" . 
   "Content-Type: text/html; charset=ISO-8859-1\r" . 
   "Content-Transfer-Encoding: base64\r\r"; 
$headers .= chunk_split(base64_encode("$html")); 
mail($to, $subject, "", $headers); 
}

function parse_mail($mail, $param) 
{
foreach ($param as $key=>$val)
$mail=str_replace("#".$key."#",$val,$mail);
return $mail;
} 
?>

 

[attachment deleted by admin]

You are using a SMTP server that requires authentication. Somewhere, either in a config file or somewhere in the script you need to have defined a username/emailAddress and a password. If the authentication method method uses SSL you will also need to load the extension php_openssl.dll in php.ini

 

If the script you are using does not do authentication you can use this free one:

http://phpmailer.worxware.com/

use the regular PHPMmailer

 

 

HTH

Teamatomic

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.