FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Trouble with sending e-mail from simple php script
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Trouble with sending e-mail from simple php script [message #176485 is a reply to message #176483] Sun, 08 January 2012 14:34 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
M. Strobel wrote:
> Am 08.01.2012 10:20, schrieb C:
>> Even if the message were rejected, I would still see something in that
>> frame, but I get only a blank frame. Client machine rejecting the
>> message should not even be noticed by this PHP script, or would it?
>>
> You have to learn how to find and read the log files. Your script
> will not show errors if it dies.
>
> On Linux log files are only readable by root.
>
> /Str.
Probably the most common error when using mail() from within php on a
shared host is to fail to use the -f function to pass a valid sender
address to sendmail (or its analogue). Without that, the 'true' sender
is likely to be 'your-login-name(at)hosting-omain(dot)com' which will fail most
rudimentary validation and simply reject the mail.

I ALWAYS use the -f to set the sender to something like
'webmaster(at)myvirtualdomson(dot)com' and set up that virtual domain so that
webmaster is a valid known target for emails.

e.g.

mail($to, $subject, $body, $headers, "-f webmaster(at)mydomain(dot)com");

is far more likely to get through anti-relay security in the hosts
mailer system.

Start by testing the host mailer with the above line, so

mail("me(at)validmail(dot)com","test message", "From:
another(at)validmail(dot)com\r\n", -f "webmaster(at)mydomain(dot)com");

is where you should start.

If that fails to make it then you need to talk to the hosting company.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: scoping inside a block
Next Topic: Best PHP Training | PHP Development Training | PHP Training Institute
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 02:57:24 GMT 2024

Total time taken to generate the page: 0.04249 seconds