Jump to content

Sending Mail


sanfly

Recommended Posts

Hi

Im 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?



Link to comment
https://forums.phpfreaks.com/topic/14215-sending-mail/
Share on other sites

Sorry Shogun, didnt work

Ken, 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]
Link to comment
https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-56405
Share on other sites

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.net

Could it be something to do with the way my PHP is set up?
Link to comment
https://forums.phpfreaks.com/topic/14215-sending-mail/#findComment-59238
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.