From: "Keith Davis" on
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(a)gmx.de]
Sent: Monday, April 12, 2010 9:19 AM
To: Alice Wei; php-windows(a)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(a)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

From: Alice Wei on


> Date: Mon, 12 Apr 2010 09:22:53 -0500
> From: keithdavis(a)pridedallas.com
> To: harlequin2(a)gmx.de; ajwei(a)alumni.iu.edu; php-windows(a)lists.php.net
> Subject: RE: [PHP-WIN] Mail Function Not Working
>
> 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.
>
>

I host the site on my own machine, so I am not sure the answer to your question. How can I check that anyway?
Plus, the default mail program I use is Windows Mail, so would it not catch the live.com automatically as the authentication?

I am getting confused.

Alice

> -----Original Message-----
> From: Sascha Meyer [mailto:harlequin2(a)gmx.de]
> Sent: Monday, April 12, 2010 9:19 AM
> To: Alice Wei; php-windows(a)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(a)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
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1