dklbwf Posted March 29, 2010 Share Posted March 29, 2010 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] Link to comment https://forums.phpfreaks.com/topic/196831-helpsending-mail-with-standard-php-mail-via-external-smtp-server/ Share on other sites More sharing options...
trq Posted March 29, 2010 Share Posted March 29, 2010 PHP's standard mail function does not support authentication against a remote mail server. You will need to use a third party library like PHPMailer (Google it). Link to comment https://forums.phpfreaks.com/topic/196831-helpsending-mail-with-standard-php-mail-via-external-smtp-server/#findComment-1033296 Share on other sites More sharing options...
teamatomic Posted March 29, 2010 Share Posted March 29, 2010 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 Link to comment https://forums.phpfreaks.com/topic/196831-helpsending-mail-with-standard-php-mail-via-external-smtp-server/#findComment-1033301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.