Re: Problems with mail() function
| From: | Tolga \"thorr\" Orhon | Date: | Wed, 23 May 2001 16:03:41 +0000 |
| Subject: | Re: Problems with mail() function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54092@lists.php.net to get a copy of this message | ||
I had smilar problems before and found out that I missed some "\n"s. It
seems that you missed a "\n" at the end of headers. That might be a reason.
Another solution might be replacing "\n"s with "\r\n". I heard in newsgroups
and in some documentations that this might be problem in some systems.
I recommend to read the source of message after you get it. It is a nce way
to debug problems and gives out lots of information. (correct headres,
messages etc..)
Yours,
--
Tolga 'thorr' Orhon
""Kevin Fogleman"" <kevin@nstrategies.com> wrote in message
news:9egjrq$r15$1@toye.p.sourceforge.net...
> The problems that I'm having with the mail function stem from the extra
> arguments that I'm trying to pass it. What I'm trying to do is write a
> script to mail links to interesting stories to other people. In doing
this,
> I want to make the mail appear that it came from the e-mail address of the
> person who wanted to send the link. So, what I've tried so far is this:
>
> $message_subject="This message is a test";
> $extraparams="From:
>
".$HTTP_POST_VARS['youraddress']."\nReply-To:".$HTTP_POST_VARS['youraddress'
> ]."\nX-Mailer: PHP/". phpversion();
>
> $message=$message_header.$HTTP_POST_VARS['message'].$message_footer;
> $success=mail($HTTP_POST_VARS['email'], $message_subject, $message,
> $extra_params)
> or die("Whoops, looks like mail() isn't configured
in
> this installation of PHP!");
>
> The message that I recieve when I run this script has a "From:" field
> reading as the user that the script is running under on the web server,
and
> I recieve a blank message body, as well as no subject.
>
> I decided to try using the mail() function with just the first three
> arguments (i.e. the destination address, the subject, and the message
body),
> and it kind of worked, meaning that it sent me a message with the correct
> subject filled out, and the correct message body, but it was still coming
> from the same address, the name of the web server user. Can someone help
me
> with placing the correct args in the 4th parameter to get mail() or
Sendmail
> or whatever to send a message with the correct return address and From:
> field?
>
> Thank you,
>
> Kevin Fogleman
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>