Richard Korts
asked on
Automated Emailing
We have a list of email addresses we want to send a fixed format email to.
The php program is in the attached file called email_batch.txt.
A sample of a small file of email addresses is attached in the file email_text.txt.
The script was run & the email was received by some (but not all) of the reciepients.
We are not clear that the script is working right.
Are there any problems with this script that would cause it to fail?
email-batch.txt
email-test.txt
The php program is in the attached file called email_batch.txt.
A sample of a small file of email addresses is attached in the file email_text.txt.
The script was run & the email was received by some (but not all) of the reciepients.
We are not clear that the script is working right.
Are there any problems with this script that would cause it to fail?
email-batch.txt
email-test.txt
You are attempting to use the mail function to send HTML formatted mail. To do this successfully you need to use something like the PEAR mail classes from www.pear.php.net
http://www.pear.php.net/package/Mail_Mime
http://www.pear.php.net/package/Mail
These would then be used as follows:
http://www.pear.php.net/package/Mail_Mime
http://www.pear.php.net/package/Mail
These would then be used as follows:
$customerEmail = "<html><head><title>$subject</title>".$this->styles."</head>";
$customerEmail .= "<body>";
if ( $subjHdr != "" )
$customerEmail .= "<h3>$subjHdr</h3>";
$customerEmail .= $mess . $attMess;
$customerEmail .= "</body></html>";
$mime->setHtmlBody($customerEmail);
$body = $mime->get();
$hdrs = $mime->headers($headers);
$mail = &Mail::factory('mail');
$result = ($mail->send($to, $hdrs, $body) == 1);
ASKER
To bportlock:
In the test file is my own email address. It sent it fine to me & I know 7 of the 10 names in the file received it too.
The email is formatted (html wise) correctly.
Whay is that?
In the test file is my own email address. It sent it fine to me & I know 7 of the 10 names in the file received it too.
The email is formatted (html wise) correctly.
Whay is that?
ASKER
To hielo:
In the test file is my own email address. It sent it fine to me & I know 7 of the 10 names in the file received it too.
I realize the file is not "truly" csv, but it seems to work at least MOST of the time.
Why is that?
In the test file is my own email address. It sent it fine to me & I know 7 of the 10 names in the file received it too.
I realize the file is not "truly" csv, but it seems to work at least MOST of the time.
Why is that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you don't have comma-separated list of email addresses. you have one email address per line. So try this :
Open in new window