mail() function doesn't seem to be sending MAIL FROM: properly

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm trying to send an email using the mail() function. I've carefully
made use of the ini_set(SMTP, "") function to set my SMTP
server and also to set my From: address. I'm still getting a "Relaying
not explicitly allowed:" response from the
server however, when I try and set a recipient who is outside of my own
domain. This makes my think that the From: address is somehow not
getting sent to my server properly or that I'm pointing at the wrong

The confounding thing is that it was working for a while and I don't
think I changed anything and it just stopped.

I'm running these PHP pages for a client off of one of those cheap
hosting services, I think it's called or something,
although I can't remember at the moment.

Has anyone else had trouble with this or found a solution?

Many thanks,

Re: mail() function doesn't seem to be sending MAIL FROM: properly wrote:
Quoted text here. Click to load it


Your hosting service probably requires authentication to send mail.
Otherwise they'd be open relays for spammers - just put your email
address in the From: field and send away.

One way is to run a mail server on your test machine - but ensure you
have port 25 firewalled or you will become an open relay.

A better way is to use PHPMailer which will do SMTP authentication.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline