Mail Function Not Working
Mail Function Not Working
am 12.04.2010 15:19:57 von Alice Wei
--_96954443-129e-48bf-a173-83dd4cf4a365_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I have an issue here where I see no PHP errors on my mail=20
function usage=2C and yet I am not getting the mail in the desired=20
account. Here is what I have for my PHP code:
$headers =3D "From: ajwei@alumni.iu.edu" =3B
$to =3D $email=3B
$subject =
"Comments Regarding My Site"=3B
$body =3D "From: $your_name\n E-Mail:=20
$email\n Reason Contact: $question\n Comments:\n $comments"=3B
mail($to=2C
$subject=2C $body=2C$headers)=3B
This is what I have in my PHP.ini:
[mail
function]
=3B For Win32 only.
SMTP =3D smtp.live.com
smtp_port =
587
=3B For Win32 only.
sendmail_from =3D ajwei@alumni.iu.edu
=3B
For Unix only. You may supply arguments as well (default: "sendmail -t
-i").
=3Bsendmail_path =3D
=3B Force the addition of the specified=20
parameters to be passed as extra parameters
=3B to the sendmail binary.
These parameters will always replace the value of
=3B the 5th=20
parameter to mail()=2C even in safe mode.
=3Bmail.force_extra_parameters =3D
Yet=2C I don't see any mail in the mail box with the address $email is at. =
Can anyone on the list please give me=20
some pointers on what I may have done wrong here?=20
Thanks for your help.
Alice
=20
=20
____________________________________________________________ _____
Hotmail is redefining busy with tools for the New Busy. Get more from your =
inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTAGL:O=
N:WL:en-US:WM_HMP:042010_2=
--_96954443-129e-48bf-a173-83dd4cf4a365_--
RE: Mail Function Not Working
am 12.04.2010 15:47:30 von Keith Davis
Why are you using Live's SMTP servers? Is this hosted on live.com? If it
is not, I am sure they will require authentication, if thy allow for
this at all. If it is hosted there, probably needs to be localhost as
the smtp server.
Keith Davis (214) 906-5183
-----Original Message-----
From: Alice Wei [mailto:ajwei@alumni.iu.edu]=20
Sent: Monday, April 12, 2010 8:20 AM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Mail Function Not Working
Hi,=20
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 =3D "From: ajwei@alumni.iu.edu" ; $to =3D $email; $subject =3D
"Comments Regarding My Site"; $body =3D "From: $your_name\n E-Mail:=20
$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 =3D smtp.live.com
smtp_port =3D
587
; For Win32 only.
sendmail_from =3D ajwei@alumni.iu.edu
;
For Unix only. You may supply arguments as well (default: "sendmail -t
-i").
;sendmail_path =3D
; Force the addition of the specified
parameters to be passed as extra parameters ; to the sendmail binary.
These parameters will always replace the value of ; the 5th parameter
to mail(), even in safe mode.
;mail.force_extra_parameters =3D
Yet, I don't see any mail in the mail box with the address $email is at.
Can anyone on the list please give me some pointers on what I may have
done wrong here?=20
Thanks for your help.
Alice
=20
=09
____________________________________________________________ _____
Hotmail is redefining busy with tools for the New Busy. Get more from
your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTAGL=
:
ON:WL:en-US:WM_HMP:042010_2
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
Re: Mail Function Not Working
am 12.04.2010 15:54:24 von Richard Quadling
On 12 April 2010 14:47, Keith Davis wrote:
> Why are you using Live's SMTP servers? Is this hosted on live.com? If it
> is not, I am sure they will require authentication, if thy allow for
> this at all. If it is hosted there, probably needs to be localhost as
> the smtp server.
>
> Keith Davis (214) 906-5183
>
> -----Original Message-----
> From: Alice Wei [mailto:ajwei@alumni.iu.edu]
> Sent: Monday, April 12, 2010 8:20 AM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Mail Function Not Working
>
>
>
>
>
>
>
> Hi,
>
> 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 =3D "From: ajwei@alumni.iu.edu" ; $to =3D Â $email; $subject=
=3D
> "Comments Regarding My Site"; $body =3D "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 =3D smtp.live.com
> smtp_port =3D
> 587
>
> ; For Win32 only.
> sendmail_from =3D ajwei@alumni.iu.edu
>
> ;
> Â For Unix only. Â You may supply arguments as well (default: "se=
ndmail -t
> -i").
> ;sendmail_path =3D
>
> ; Force the addition of the specified
> parameters to be passed as extra parameters ; to the sendmail binary.
> Â These parameters will always replace the value of ; the 5th paramet=
er
> to mail(), even in safe mode.
> ;mail.force_extra_parameters =3D
>
> Yet, I don't see any mail in the mail box with the address $email is at.
> Can anyone on the list please give me some pointers on what I may have
> done wrong here?
>
> Thanks for your help.
> Alice
>
>
>
> ____________________________________________________________ _____
> Hotmail is redefining busy with tools for the New Busy. Get more from
> your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTAGL=
:
> ON:WL:en-US:WM_HMP:042010_2
>
> This message (including any attachments) may contain confidential or othe=
rwise 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 di=
sseminate, distribute or copy this e-mail. Please notify the sender immedia=
tely 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 sec=
ured or error-free as information could be intercepted, corrupted, lost, de=
stroyed, arrive late or incomplete, or contain viruses. The sender therefor=
e 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 verificat=
ion 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
>
>
The recipient (held in $email) needs to be an address held on the
live.com server.
You will not be able to use the live.com mail servers to send email to
me (at GMail.com), for example.
That is called relaying and more specifically, due to the lack of
security, an open relay.
If you want to use live.com to send email to someone not on their
servers, then you would need to use authentication. This may not be
just a case of a username/password, but also logging into your POP3
mailbox as a proof of a "real" program and user.
--=20
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
ZOPA : http://uk.zopa.com/member/RQuadling
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Mail Function Not Working
am 12.04.2010 16:13:23 von Alice Wei
--_351425d9-85f7-421e-b477-19ec1a713c01_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
> From: rquadling@googlemail.com
> Date: Mon=2C 12 Apr 2010 14:54:24 +0100
> To: keithdavis@pridedallas.com
> CC: ajwei@alumni.iu.edu=3B php-windows@lists.php.net
> Subject: Re: [PHP-WIN] Mail Function Not Working
>=20
> On 12 April 2010 14:47=2C Keith Davis wrote:
> > Why are you using Live's SMTP servers? Is this hosted on live.com? If i=
t
> > is not=2C I am sure they will require authentication=2C if thy allow fo=
r
> > this at all. If it is hosted there=2C probably needs to be localhost as
> > the smtp server.
> >
> > Keith Davis (214) 906-5183
> >
> > -----Original Message-----
> > From: Alice Wei [mailto:ajwei@alumni.iu.edu]
> > Sent: Monday=2C April 12=2C 2010 8:20 AM
> > To: php-windows@lists.php.net
> > Subject: [PHP-WIN] Mail Function Not Working
> >
> > Hi=2C
> >
> > I have an issue here where I see no PHP errors on my mail function
> > usage=2C and yet I am not getting the mail in the desired account. Here=
is
> > what I have for my PHP code:
> >
> > $headers =3D "From: ajwei@alumni.iu.edu" =3B $to =3D $email=3B $subjec=
t =3D
> > "Comments Regarding My Site"=3B $body =3D "From: $your_name\n E-Mail:
> > $email\n Reason Contact: $question\n Comments:\n $comments"=3B mail($to=
=2C
> > $subject=2C $body=2C$headers)=3B
> >
> > This is what I have in my PHP.ini:
> >
> > [mail
> > function]
> > =3B For Win32 only.
> > SMTP =3D smtp.live.com
> > smtp_port =3D
> > 587
> >
> > =3B For Win32 only.
> > sendmail_from =3D ajwei@alumni.iu.edu
> >
> > =3B
> > For Unix only. You may supply arguments as well (default: "sendmail -=
t
> > -i").
> > =3Bsendmail_path =3D
> >
> > =3B Force the addition of the specified
> > parameters to be passed as extra parameters =3B to the sendmail binary.
> > These parameters will always replace the value of =3B the 5th paramete=
r
> > to mail()=2C even in safe mode.
> > =3Bmail.force_extra_parameters =3D
> >
> > Yet=2C I don't see any mail in the mail box with the address $email is =
at.
> > Can anyone on the list please give me some pointers on what I may have
> > done wrong here?
> >
> > Thanks for your help.
> > Alice
> >
> >
> >
> > ____________________________________________________________ _____
> > Hotmail is redefining busy with tools for the New Busy. Get more from
> > your inbox.
> > http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTA=
GL:
> > ON:WL:en-US:WM_HMP:042010_2
> >
> > This message (including any attachments) may contain confidential or ot=
herwise privileged information and is intended only for the individual(s) t=
o which it is addressed. If you are not the named addressee you should not =
disseminate=2C distribute or copy this e-mail. Please notify the sender imm=
ediately by e-mail if you have received this e-mail by mistake and delete t=
his e-mail from your system. E-mail transmission cannot be guaranteed to be=
secured or error-free as information could be intercepted=2C corrupted=2C =
lost=2C destroyed=2C arrive late or incomplete=2C or contain viruses. The s=
ender therefore does not accept liability for any errors or omissions in th=
e 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 s=
ender.
> >
> > www.pridedallas.com
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe=2C visit: http://www.php.net/unsub.php
> >
> >
>=20
> The recipient (held in $email) needs to be an address held on the
> live.com server.
>=20
> You will not be able to use the live.com mail servers to send email to
> me (at GMail.com)=2C for example.
>=20
> That is called relaying and more specifically=2C due to the lack of
> security=2C an open relay.
>=20
> If you want to use live.com to send email to someone not on their
> servers=2C then you would need to use authentication. This may not be
> just a case of a username/password=2C but also logging into your POP3
> mailbox as a proof of a "real" program and user.
>=20
>=20
>=20
> --=20
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D2134=
74731
> ZOPA : http://uk.zopa.com/member/RQuadling
>=20
> --=20
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe=2C visit: http://www.php.net/unsub.php
>=20
No=2C the site I am creating is not on the live.com server=2C so in this ca=
se=2C looks like I would be relaying it. From what you said=2C looks like P=
OP3=2C pop3.live.com is not going to work=20
either.
I have set up Windows Mail as my default mail program=2C but if relaying is=
not going to work=2C then which addresses can I use to send emails to reci=
pients who use the site?=20
Thanks for your help.
Alice
=20
____________________________________________________________ _____
Hotmail has tools for the New Busy. Search=2C chat and e-mail from your inb=
ox.
http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTAGL:O=
N:WL:en-US:WM_HMP:042010_1=
--_351425d9-85f7-421e-b477-19ec1a713c01_--
Re: Mail Function Not Working
am 12.04.2010 16:19:28 von harlequin2
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-Sc ript/
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
RE: Mail Function Not Working
am 12.04.2010 16:22:53 von Keith Davis
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]=20
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=20
> function usage, and yet I am not getting the mail in the desired=20
> account. Here is what I have for my PHP code:
>=20
> $headers =3D "From: ajwei@alumni.iu.edu" ;
> $to =3D $email;
> $subject =
> "Comments Regarding My Site";
> $body =3D "From: $your_name\n E-Mail:=20
> $email\n Reason Contact: $question\n Comments:\n $comments";
> mail($to,
> $subject, $body,$headers);
>=20
> This is what I have in my PHP.ini:
>=20
> [mail
> function]
> ; For Win32 only.
> SMTP =3D 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_Authenti=
cation.htm
http://www.codewalkers.com/c/a/Email-Code/Smtp-Auth-Email-Sc ript/
If your provider requires "SMTP after POP", it will be quite tricky (but =
not impossible) to send mails with PHP.
Regards,
Sascha
--=20
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
--=20
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
RE: Mail Function Not Working
am 12.04.2010 16:26:25 von Alice Wei
--_10647d97-7433-46fd-bddc-be43b8243897_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
> Date: Mon=2C 12 Apr 2010 09:22:53 -0500
> From: keithdavis@pridedallas.com
> To: harlequin2@gmx.de=3B ajwei@alumni.iu.edu=3B php-windows@lists.php.net
> Subject: RE: [PHP-WIN] Mail Function Not Working
>=20
> Where is your site being hosted? Does the hosting server have SMTP availa=
ble? That is the easiest method and what I use for 99% of my sites.
>=20
>=20
I host the site on my own machine=2C so I am not sure the answer to your =
question. How can I check that anyway?
Plus=2C the default mail program I use is Windows Mail=2C so would it not=
catch the live.com automatically as the authentication?
I am getting confused.
Alice
> -----Original Message-----
> From: Sascha Meyer [mailto:harlequin2@gmx.de]=20
> Sent: Monday=2C April 12=2C 2010 9:19 AM
> To: Alice Wei=3B php-windows@lists.php.net
> Subject: Re: [PHP-WIN] Mail Function Not Working
>=20
> Hi Alice=2C
>=20
> Alice wrote:
> > I have an issue here where I see no PHP errors on my mail=20
> > function usage=2C and yet I am not getting the mail in the desired=20
> > account. Here is what I have for my PHP code:
> >=20
> > $headers =3D "From: ajwei@alumni.iu.edu" =3B
> > $to =3D $email=3B
> > $subject =
> > "Comments Regarding My Site"=3B
> > $body =3D "From: $your_name\n E-Mail:=20
> > $email\n Reason Contact: $question\n Comments:\n $comments"=3B
> > mail($to=2C
> > $subject=2C $body=2C$headers)=3B
> >=20
> > This is what I have in my PHP.ini:
> >=20
> > [mail
> > function]
> > =3B For Win32 only.
> > SMTP =3D smtp.live.com
> > smtp_port =
> > 587
> > ...
>=20
> As Keith and Richard already told=2C it is not enough to point PHP to an =
existing mail server=2C you also need to take care of proper authentication=
or relaying of messages.
>=20
> To get you started=2C here are two tutorials for sending mails with SMTP =
authentication (one using a PEAR class=2C the other uses sockets instead of=
the mail function):
>=20
> http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_ SMTP_Authenti=
cation.htm
> http://www.codewalkers.com/c/a/Email-Code/Smtp-Auth-Email-Sc ript/
>=20
> If your provider requires "SMTP after POP"=2C it will be quite tricky (bu=
t not impossible) to send mails with PHP.
>=20
> Regards=2C
>=20
> Sascha
>=20
> --=20
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>=20
> --=20
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe=2C visit: http://www.php.net/unsub.php
>=20
>=20
> This message (including any attachments) may contain confidential or othe=
rwise 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 di=
sseminate=2C distribute or copy this e-mail. Please notify the sender immed=
iately by e-mail if you have received this e-mail by mistake and delete thi=
s e-mail from your system. E-mail transmission cannot be guaranteed to be s=
ecured or error-free as information could be intercepted=2C corrupted=2C lo=
st=2C destroyed=2C arrive late or incomplete=2C or contain viruses. The sen=
der 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 sen=
der.
>=20
> www.pridedallas.com
>=20
>=20
> --=20
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe=2C visit: http://www.php.net/unsub.php
>=20
=20
____________________________________________________________ _____
Hotmail has tools for the New Busy. Search=2C chat and e-mail from your inb=
ox.
http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTAGL:O=
N:WL:en-US:WM_HMP:042010_1=
--_10647d97-7433-46fd-bddc-be43b8243897_--