|
Posted by Jeff on 01/08/07 22:31
"Tyrone Slothrop" <ts@paranoids.com> wrote in message
news:h0t4q2p9ptlr7lbvhl75plnk9jkdnsv199@4ax.com...
> On Mon, 8 Jan 2007 15:14:21 +0100, "Jeff"
> <it_consultant1@hotmail.com.NOSPAM> wrote:
>
>>Hey
>>
>>I'm developing a web site using php version 5.2.0. Users are offered to
>>register at the web site. To complete the registration the user will get
>>an
>>email containg a link he need to use for to activate his account....
>>
>>But sending email from my web site isn't working.
>>I get this error:
>>Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or
>>custom "From:" header missing in C:\Inetpub\wwwroot\demo\registration.php
>>on
>>line 21
>>
>>This is the code the errror message above is refering to:
>>mail($email, "test av website", "helloworld",
>>"it_consultant1@hotmail.com");
>>
>>my php.ini:
>>; For Win32 only.
>>sendmail_from = it_consultant1@hotmail.com
>>
>>; For Unix only. You may supply arguments as well (default:
>>"sendmail -t -i").
>>;sendmail_path =
>>
>>This is on a winXP computer, so I didn't set the sendmail_path (the
>>php.ini
>>says sendmail_path is for unix only)
>>
>>Any suggestions on what I should do to solve this?
>>
>>Jeff
>
> I believe your problem is with the header that you are sending. The
> format for the mail function is:
> mail ($to, $subject, $text_body, $headers);
>
> Headers must be formed in an acceptable format:
> $headers = "From: someone@somedomain.com\nBcc: bcc@somedomain.com\n";
> etc.
>
After re-reading the documentation about the mail function I realize that
the mail function don't need addional headers in order to work. I've read in
the documentation that mail() can accept only 3 parameters:
http://no.php.net/manual/en/function.mail.php
This is my code sending the mail:
mail($email, "test av website", "helloworld");
This is the error I get:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or
custom "From:" header missing in C:\Inetpub\wwwroot\demo\registration.php on
line 24
The problem must be related to the sendmail_from settings in php.ini:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = it_consultant1@hotmail.com
Any suggestions?
Jeff
Navigation:
[Reply to this message]
|