sanfly Posted July 10, 2006 Share Posted July 10, 2006 HiIm trying to get an HTML sendmail script to work, but I am getting the follwing error:[code]Warning: mail() [function.mail]: SMTP server response: 501 <Intergalactic Records<******@*******.com>>: "@" or "." expected after "Intergalactic" in C:\server\www\adv_admin\admin\maillist.php on line 858[/code]My "From" header is:[code]$headers .= "From: $ml_from_name <$ml_from_email>" . "\r\n";[/code]Can anyone help me out? Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/ Share on other sites More sharing options...
kenrbnsn Posted July 10, 2006 Share Posted July 10, 2006 Can you post the rest of the code that creates the mail?Ken Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-55785 Share on other sites More sharing options...
sanfly Posted July 10, 2006 Author Share Posted July 10, 2006 Will have to be later, Im at work now and the code is on my home PCI would have thought the code I posted was enough find the error though? Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-55837 Share on other sites More sharing options...
kenrbnsn Posted July 10, 2006 Share Posted July 10, 2006 No, you posted one PHP line out of context. you didn't even post the mail() function call. How can we debug your problems without more data?Ken Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-55870 Share on other sites More sharing options...
ShogunWarrior Posted July 10, 2006 Share Posted July 10, 2006 Making a stab at it I'm going to say that maybe you need quotes around the name like so:"David Doran" <daviddoranmedia@gmail.com>so it might be:[code]$headers .= "From: \"$ml_from_name\" <$ml_from_email>" . "\r\n";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-55877 Share on other sites More sharing options...
sanfly Posted July 11, 2006 Author Share Posted July 11, 2006 Sorry Shogun, didnt workKen, is this enough? It's to send HTML email[code]// send emails to mailing list $total = 0; $f = 0; if(in_array("maillist", $mle_recip)){ echo "<b>MAILING LIST</b><br>"; include "db.php"; $r = mysql_query("SELECT * FROM ml_recipients WHERE mlr_active = '1'") or die(mysql_error()); $num = mysql_num_rows($r); $total = $total + $num; $x = 1; $i = 0; while($row = mysql_fetch_array($r)){ $mlr_email = $row['mlr_email']; $recipient = stripslashes($row['mlr_name']); $message = $message_pre1; // The header of the message $message .= $recipient; // The recipients name $message .= $message_pre2; // The part of the message between the recip name and the main message $message .= nl2br($mle_message); // The main message $message .= $message_post; // The message footer $hold = 50; // quantity of emails sent before 3 sec delay // email Headers $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: $ml_from_name <$ml_from_email>" . "\r\n"; // Mail it if(mail($mlr_email, $mle_subject, $message, $headers)){ echo "SENT: $mlr_email<br>"; $i++; $x++; if($x == $hold) { // When $x is equal to $hold, a 3 sec delay will occur avoiding php to timeout sleep(3); $x = 0; } } else{ $f++; echo "FAILED: $mlr_email<br>"; } } echo "<br><br>"; }[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-56405 Share on other sites More sharing options...
sanfly Posted July 13, 2006 Author Share Posted July 13, 2006 Bump Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-57598 Share on other sites More sharing options...
sanfly Posted July 17, 2006 Author Share Posted July 17, 2006 I have the same problem when I copy the html email example exactly from the example (with my own domain substituted for example.com) on the [url=http://]http://nz.php.net/manual/en/function.mail.php[/url] mail function page at php.netCould it be something to do with the way my PHP is set up? Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-59238 Share on other sites More sharing options...
ShogunWarrior Posted July 17, 2006 Share Posted July 17, 2006 I think the problem is the SMTP mail server. Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-59243 Share on other sites More sharing options...
sanfly Posted July 17, 2006 Author Share Posted July 17, 2006 Its definitely a setting on my computer. I just uploaded to the website server and everything works fine.Can anyone help me figure out what the error in my settings might be? Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-59255 Share on other sites More sharing options...
ShogunWarrior Posted July 17, 2006 Share Posted July 17, 2006 If you're working on Windows, and you're website server is Linux then the problem is probably that the mail is not being sent properly by your SMTP Local Server(if one is set up), but that the Linux Sendmail is working fine. Quote Link to comment https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-59304 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.