Mail Function Problem

Mail Function Problem

am 12.04.2010 04:33:23 von Alice Wei

--_e02457b9-9117-4c22-a80d-6abfaea6d71c_
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 function usage=2C=
and yet I am not getting the mail in the desired account. Here is what I h=
ave for my PHP code:

$headers =3D "From: ajwei@alumni.iu.edu"=3B
$to =3D "ajwei@alumni.iu.edu "=3B
$subject =3D "Comments Regarding My Studio"=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 pa=
rameters
=3B to the sendmail binary. These parameters will always replace the value =
of
=3B the 5th parameter to mail()=2C even in safe mode.
=3Bmail.force_extra_parameters =3D

Yet=2C I don't see any mail in my ajwei@alumni.iu.edu Mailbox=2C can anyone=
on the list please give me some pointers on what I may have done wrong her=
e?
Thanks for your help.
=20
____________________________________________________________ _____
The New Busy is not the old busy. Search=2C chat and e-mail from your inbox=
..
http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTAGL:O=
N:WL:en-US:WM_HMP:042010_3=

--_e02457b9-9117-4c22-a80d-6abfaea6d71c_--

Re: Mail Function Problem

am 12.04.2010 05:22:26 von Kevin Kinsey

Alice Wei wrote:
> 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 = "From: ajwei@alumni.iu.edu";
> $to = "ajwei@alumni.iu.edu ";
> $subject = "Comments Regarding My Studio";
> $body = "From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments";
> mail($to, $subject, $body,$headers);

I don't see any way for you to know if there are any errors.

Try this as a very basic start:

$headers = "From: ajwei@alumni.iu.edu";
$to = "ajwei@alumni.iu.edu ";
$subject = "Comments Regarding My Studio";
$body = "From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments";
$success=mail($to, $subject, $body,$headers);

if ($success) {
echo "Mail was sent successfully!";
} else {
echo "Sending of mail failed!";
}



> This is what I have in my PHP.ini:
>
> [mail function]
> ; For Win32 only.
> SMTP = smtp.live.com
> smtp_port = 587
>
> ; For Win32 only.
> sendmail_from = ajwei@alumni.iu.edu
>
> ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
> ;sendmail_path =
>
> ; 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 =
>
> Yet, I don't see any mail in my ajwei@alumni.iu.edu Mailbox, can
> anyone on the list please give me some pointers on what I may have done wrong here?
> Thanks for your help.

Thanks to the worldwide brotherhood of crooks known as spammers,
sending e-mail these days isn't nearly as easy as PHP makes it look.
You might wanna look into an "errors-to" header to help debug any
problems with sender authorization, bad ports, etc.

HTH,

KDK

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Mail Function Problem

am 12.04.2010 13:09:48 von Peter Lind

On 12 April 2010 05:22, Kevin Kinsey wrote:
>
> Thanks to the worldwide brotherhood of crooks known as spammers,
> sending e-mail these days isn't nearly as easy as PHP makes it look.
> You might wanna look into an "errors-to" header to help debug any
> problems with sender authorization, bad ports, etc.
>

Along these lines: there's a chance that sending a mail from yourself,
to yourself, through PHP like this, will cause mail servers to think
it's spam. For testing email sending, normal scenarios are better
(i.e. send an email to another account).

Regards
Peter

--

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Mail Function Problem

am 12.04.2010 13:18:56 von Alice Wei

--_389121aa-d918-4367-9a3c-07982721e901_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



> From: peter.e.lind@gmail.com
> Date: Mon=2C 12 Apr 2010 13:09:48 +0200
> Subject: Re: [PHP] Mail Function Problem
> To: kdk@daleco.biz
> CC: ajwei@alumni.iu.edu=3B php-general@lists.php.net
>=20
> On 12 April 2010 05:22=2C Kevin Kinsey wrote:
> >
> > Thanks to the worldwide brotherhood of crooks known as spammers=2C
> > sending e-mail these days isn't nearly as easy as PHP makes it look.
> > You might wanna look into an "errors-to" header to help debug any
> > problems with sender authorization=2C bad ports=2C etc.
> >
>=20
> Along these lines: there's a chance that sending a mail from yourself=2C
> to yourself=2C through PHP like this=2C will cause mail servers to think
> it's spam. For testing email sending=2C normal scenarios are better
> (i.e. send an email to another account).
>=20
> Regards
> Peter
>=20
> --=20
>
> WWW: http://plphp.dk / http://plind.dk
> LinkedIn: http://www.linkedin.com/in/plind
> Flickr: http://www.flickr.com/photos/fake51
> BeWelcome: Fake51
> Couchsurfing: Fake51
>


I have changed my $to to $email=2C so it is not the same email address as t=
he $from. I also added Kevin's lines with the parameters that April suggest=
ed=2C and it looks like I still get Sending Mail failed. Which function sho=
uld I use to find out why my sending mail failed?

Thanks for your help.

Alice
=20
____________________________________________________________ _____
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with H=
otmail.=20
http://www.windowslive.com/campaign/thenewbusy?tile=3Dmultic alendar&ocid=3D=
PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5=

--_389121aa-d918-4367-9a3c-07982721e901_--

Re: Mail Function Problem

am 12.04.2010 13:26:46 von Alexey Bovanenko

--00032555b8229e16ba0484086b2a
Content-Type: text/plain; charset=UTF-8

Hi!

You have the following php.ini params:
SMTP = smtp.live.com
smtp_port = 587

live.com not support relay and it requires authentication.


On Mon, Apr 12, 2010 at 6:33 AM, Alice Wei wrote:

>
> 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 = "From: ajwei@alumni.iu.edu";
> $to = "ajwei@alumni.iu.edu ";
> $subject = "Comments Regarding My Studio";
> $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
>
> ; For Win32 only.
> sendmail_from = ajwei@alumni.iu.edu
>
> ; For Unix only. You may supply arguments as well (default: "sendmail -t
> -i").
> ;sendmail_path =
>
> ; 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 =
>
> Yet, I don't see any mail in my ajwei@alumni.iu.edu Mailbox, can anyone on
> the list please give me some pointers on what I may have done wrong here?
> Thanks for your help.
>
> ____________________________________________________________ _____
> The New Busy is not the old 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_3




--
With regards,
Alexei Bovanenko

--00032555b8229e16ba0484086b2a--

RE: Mail Function Problem

am 12.04.2010 13:29:22 von Alice Wei

--_43827a09-0745-4fca-805c-3e8a28b28e15_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



Date: Mon=2C 12 Apr 2010 15:26:46 +0400
Subject: Re: [PHP] Mail Function Problem
From: a.bovanenko@gmail.com
To: ajwei@alumni.iu.edu
CC: php-general@lists.php.net

Hi!
You have the following php.ini params:SMTP =3D smtp.live.com

smtp_port =3D 587
live.com not support relay and it requires authentication.

Is there an email account that I could try? I thought most email accounts r=
equires authentication anyway.


Thanks for your help.

Alice

On Mon=2C Apr 12=2C 2010 at 6:33 AM=2C Alice Wei wrot=
e:



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 h=
ave for my PHP code:



$headers =3D "From: ajwei@alumni.iu.edu"=3B

$to =3D "ajwei@alumni.iu.edu "=3B

$subject =3D "Comments Regarding My Studio"=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 pa=
rameters

=3B to the sendmail binary. These parameters will always replace the value =
of

=3B the 5th parameter to mail()=2C even in safe mode.

=3Bmail.force_extra_parameters =3D



Yet=2C I don't see any mail in my ajwei@alumni.iu.edu Mailbox=2C can anyone=
on the list please give me some pointers on what I may have done wrong her=
e?

Thanks for your help.



____________________________________________________________ _____

The New Busy is not the old busy. Search=2C chat and e-mail from your inbox=
..

http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID283 26::T:WLMTAGL:O=
N:WL:en-US:WM_HMP:042010_3


--=20
With regards=2C
Alexei Bovanenko

=20
____________________________________________________________ _____
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with H=
otmail.=20
http://www.windowslive.com/campaign/thenewbusy?tile=3Dmultic alendar&ocid=3D=
PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5=

--_43827a09-0745-4fca-805c-3e8a28b28e15_--

Re: Mail Function Problem

am 12.04.2010 18:09:42 von Kevin Kinsey

Alice Wei wrote:
>> Hi!
>> You have the following php.ini params:SMTP = smtp.live.com
>>
>> smtp_port = 587
>> live.com not support relay and it requires authentication.
>
> Is there an email account that I could try? I thought
> most email accounts requires authentication anyway.

Well, "therein lies the rub," as the Bard said (maybe).
PHP's mail() was built on a general assumption that
there would be a local SMTP server. It supports remote
SMTP, but I'm not aware of any ability to do SMTP auth,
even in the PEAR packages.

You might just wanna read up on mail in general. The
php.net/mail page lists several relevant RFC's, and
has links to most of the PEAR mail classes, etc.

You should definitely read up on live.com's email
configuration. If they use SMTP auth, I'm not sure
you can do this (per above). If it uses, say, "POP
before SMTP" for authorization, you might be able to
hack something together with the PHP IMAP functions, or
even sockets, but you're getting into a big lotta work
for what seems a small thing.

Kevin Kinsey

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php