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 <MyMail@ono.com>');
   
    /**
    * 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.