Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
June 27, 2005, 8:16 pm
rate this thread
I'm trying to send an email using the mail() function. I've carefully
made use of the ini_set(SMTP, "mail.my.server") function to set my SMTP
server and also to set my From: address. I'm still getting a "Relaying
not explicitly allowed: email@example.com" 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 1dollarhost.com or something,
although I can't remember at the moment.
Has anyone else had trouble with this or found a solution?
Re: mail() function doesn't seem to be sending MAIL FROM: properly
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
JDS Computer Training Corp.
- » converting special symbols to escaped characters and vice versa
- — Previous thread in » PHP Scripting Forum