RE: [PHP-WIN] Mail Function Not Working
| From: | Keith Davis | Date: | Mon, 12 Apr 2010 14:22:53 +0000 |
| Subject: | RE: [PHP-WIN] Mail Function Not Working | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-30013@lists.php.net to get a copy of this message | ||
Where is your site being hosted? Does the hosting server have SMTP available? That is the easiest
method and what I use for 99% of my sites.
Keith Davis (214) 906-5183
-----Original Message-----
From: Sascha Meyer [mailto:harlequin2@gmx.de]
Sent: Monday, April 12, 2010 9:19 AM
To: Alice Wei; php-windows@lists.php.net
Subject: Re: [PHP-WIN] Mail Function Not Working
Hi Alice,
Alice wrote:
> I have an issue here where I see no PHP errors on my mail
> function usage, and yet I am not getting the mail in the desired
> account. Here is what I have for my PHP code:
>
> $headers = "From: ajwei@alumni.iu.edu" ;
> $to = $email;
> $subject =
> "Comments Regarding My Site";
> $body = "From: $your_name\n E-Mail:
> $email\n Reason Contact: $question\n Comments:\n $comments";
> mail($to,
> $subject, $body,$headers);
>
> This is what I have in my PHP.ini:
>
> [mail
> function]
> ; For Win32 only.
> SMTP = smtp.live.com
> smtp_port =
> 587
> ...
As Keith and Richard already told, it is not enough to point PHP to an existing mail server, you
also need to take care of proper authentication or relaying of messages.
To get you started, here are two tutorials for sending mails with SMTP authentication (one using a
PEAR class, the other uses sockets instead of the mail function):
http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
http://www.codewalkers.com/c/a/Email-Code/Smtp-Auth-Email-Script/
If your provider requires "SMTP after POP", it will be quite tricky (but not impossible)
to send mails with PHP.
Regards,
Sascha
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This message (including any attachments) may contain confidential or otherwise privileged
information and is intended only for the individual(s) to which it is addressed. If you are not the
named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your
system. E-mail transmission cannot be guaranteed to be secured or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the contents of this message or
that arise as a result of e-mail transmission. If verification is required please request a
hard-copy version from the sender.
www.pridedallas.com