Jump to content

error sending mails from array!


masgas

Recommended Posts

Hi again!

I'm here trying to send some mails to a list from MySQL db, with this class from Richard Hayes and it worked fine for one adress, but when I (of course) tried to do it for more people it gave this error! (I guess it is in the $mai->send(array... somewhere!! But I am not sure! Any ideas!?

I get this error message:

Warning: mail() [function.mail]: SMTP server response: 501 <$email> Invalid mail address, must have a domain part in C:\xampp\htdocs\soa\htmlMimeMail5\htmlMimeMail5\htmlMimeMail5.php on line 743

thanks you...

if (Send == $_REQUEST[Send]) {

$con=mysql_connect('','','') or die ('no conn serv');
    mysql_select_db('mailertest') or die ('no conn db');     
$sql = "SELECT * FROM mails WHERE Nivel = '$Nivel'";
$display = mysql_query ($sql) or die ('error');
while ($row = mysql_fetch_array($display)) {
$Name = $row["Name"];
$email = $row["email"];
$Surn = $row["Surn"];
   
   
   


    require_once('../htmlMimeMail5.php');
   
    $mail = new htmlMimeMail5();

    /**
    * Set the from address
    */
    $mail->setFrom('Masgas <[email protected]>');
   
    /**
    * Set the subject
    */
    $mail->setSubject('Test email');
   
    /**
    * Set high priority
    */
    $mail->setPriority('high');

    /**
    * Set the text of the Email
    */
    $mail->setText('Sample text');
   
    /**
    * Set the HTML of the email
    */
    $mail->setHTML('<b>Sample HTML</b> <img src="background.gif">');
   
    /**
    * Add an embedded image
    */
    $mail->addEmbeddedImage(new fileEmbeddedImage('background.gif'));
   
    /**
    * Add an attachment
    */
    $mail->addAttachment(new fileAttachment('example.zip'));

    /**
    * Send the email
    */
   
  $mail->send (array('$email'));
}
}
else { echo "something is wrong";
echo $email;}
?>
Link to comment
https://forums.phpfreaks.com/topic/21785-error-sending-mails-from-array/
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.