Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending mass email with images 2

Status
Not open for further replies.

smashing

Programmer
Oct 15, 2002
170
US
Hi everyone!!
Question: Is there any way I can detect how recipients see their email?
I'm writing a PHP script that will send an email to the hundreds of people, in my MYSQL database - I'm including HTML in this email ('cause I want to display images as well) .
There are people that cannot view any HTML in their email (be it Internet cellphones or otherwise) and there also are people that don't want to see HTML and have chosen the 'view text only' feature in the email program of their choice.
I would prepare an alternate email message without any HTML in it and use an if else statement to send the appropriate form of email message. Any ideas?
 
I see that the MIME line has to be the very first line of the headers otherwise the content will not display html correctly, but if it is so, the From line will show the username@mysite.com not info@washny.com as I want it to. (And ini_set as suggested by DRJ478 doesn't seem to help at all).

Any suggestions?
 
Hi there sleipnir214!
Called up my web host. The say I'm using Sendmail version 8.12.
Thanks
 
With sendmail, there is an additional trick you have to implement.

PHP's mail() function's last imput parameter is "additional parameters". Those parameters are handed to your SMTP software.

Try adding that "additional parameters" parameter as either "-fyouruser@yourhost.com" or "-f youruser@yourhost.com" (with or without a space after "-f" -- I think it's the former, but I'm not sure).

Want the best answers? Ask the best questions: TANSTAAFL!
 
Hi there sleipnir214!
Still no luck!!!

I'm currently calling the mail function like this:

mail($to, $subject, $body, $mailheaders);

So if I change it to read

mail($to, $subject, $body, $mailheaders, -f info@washny.com)

I'll get a parse error (both with a space after the "f" or without)

or with backslashed quotes because its part of a variable:


mail($to, $subject, $body, $mailheaders, \"-f info@washny.com\")

Then I get the same parse error, (both with a space after the "f" or without) in addition to another error:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /usr/local/...


So I tried adding the line after the actual mailheades way up in my script:

$mailheaders = "MIME-Version: 1.0\n";
$mailheaders .= 'Content-Type: multipart/alternative; boundary="XXMail12345";';
$mailheaders .=&quot;From:info@washny.com<>\n&quot;;
$mailheaders .=&quot;Reply-To:info@washny.com\n\n&quot;;
$mailheaders .=&quot;-finfo@washny.com&quot;;

In which case the script will work but the From: line will still output username@mysite.com

What next??

 
OK it looks like we're getting somewhere. The error message now reads:

Warning: mail(): SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE. in /usr/local/...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top