using mail()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
liquid
Forum Newbie
Posts: 14
Joined: Thu Oct 21, 2004 2:19 pm
Location: Wyoming USA

using mail()

Post by liquid »

hello all!

I was wondering what Im doing wrong here. I have a very basic email script to send out a monlthy newsletter. However, it will only deliver to some of the emails.
My question is: Are there other header calls I need to make besides the following:

Code: Select all

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
I was reading up a bit on php.net but didnt really see or know of any other necessary headers to use. Are there other requirements for certain types of email servers?

Thanks in advance!
Keith
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You may need to send the From: header and the Reply-To: header.

When you say it's not sending some of them... are they being rejected or do they just not physically send to certaint addresses.
Error messages (if any) would be helpful too ;-)
liquid
Forum Newbie
Posts: 14
Joined: Thu Oct 21, 2004 2:19 pm
Location: Wyoming USA

Post by liquid »

ok, I included the From: and Reply-To: header but still only sends to certain email addresses. Let me reword that, it sends fine, the email just never gets delivered.

Is there some kind of error checking I can do to see whats going on with the emails?
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

some mail services automatically report "unknown" senders as spam (AOL does this for eg) are you sure this isnt happening?
liquid
Forum Newbie
Posts: 14
Joined: Thu Oct 21, 2004 2:19 pm
Location: Wyoming USA

Post by liquid »

Yes, Im pretty sure thats not happening, the strange thing is that the only emails that are not getting delivered are all "in house" email addresses. Meaning our company email addresses are the only ones not receiving the emails. Strangely enough I get umteen million <span style='color:red;text-decoration:blink' title='Alert a moderator!'>grilled spam</span> emails a day, but our legit newsletter wont come through....

Well, thanks for the suggestions, Ill keep digging!
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

are the emails you are sending in HTML format? you will need to "accept HTML emails" if this is the case
liquid
Forum Newbie
Posts: 14
Joined: Thu Oct 21, 2004 2:19 pm
Location: Wyoming USA

Post by liquid »

If you mean "accept HTML" in my mail program (Outlook), yes that is already set.
Post Reply