Problem using mail() when sending to hotmail/gmail...
Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 12:32:04 von Hush
Hi,
php beginner here...
I'm having some trouble sending mail with php to hotmail/gmail
accounts. Other domains work fine (recieved email after 2 minutes).
Hotmail accounts do not receive the mail at all.
Does anyone have any experience/solution to this issue?
My code is below:
$message = "Click this (exact) link for activation: $link";
$message = wordwrap($message, 70);
$headers = "From: supp...@xxx.com\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "Reply-To: Support \n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: My mailer";
mail($email,$subject,$message,$headers);
the $email variable is declared outside this code. And works fine.
Regards,
Hush
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 13:44:18 von flowover
On Jan 5, 3:32 am, Hush wrote:
> Hi,
>
> php beginner here...
> I'm having some trouble sending mail with php to hotmail/gmail
> accounts. Other domains work fine (recieved email after 2 minutes).
> Hotmail accounts do not receive the mail at all.
>
> Does anyone have any experience/solution to this issue?
>
> My code is below:
>
> $message = "Click this (exact) link for activation: $link";
> $message = wordwrap($message, 70);
> $headers = "From: supp...@xxx.com\n";
> $headers .= "MIME-Version: 1.0\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\n";
> $headers .= "Reply-To: Support \n";
> $headers .= "X-Priority: 1\n";
> $headers .= "X-MSMail-Priority: High\n";
> $headers .= "X-Mailer: My mailer";
>
> mail($email,$subject,$message,$headers);
>
> the $email variable is declared outside this code. And works fine.
>
> Regards,
>
> Hush
Gmail doesn't like carriage returns (\r) at all. This could be
related? Here's a discussion I found regarding it.
http://www.bigroom.co.uk/blog/php-mail-and-gmail
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 13:46:38 von flowover
On Jan 5, 3:32 am, Hush wrote:
> Hi,
>
> php beginner here...
> I'm having some trouble sending mail with php to hotmail/gmail
> accounts. Other domains work fine (recieved email after 2 minutes).
> Hotmail accounts do not receive the mail at all.
>
> Does anyone have any experience/solution to this issue?
>
> My code is below:
>
> $message = "Click this (exact) link for activation: $link";
> $message = wordwrap($message, 70);
> $headers = "From: supp...@xxx.com\n";
> $headers .= "MIME-Version: 1.0\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\n";
> $headers .= "Reply-To: Support \n";
> $headers .= "X-Priority: 1\n";
> $headers .= "X-MSMail-Priority: High\n";
> $headers .= "X-Mailer: My mailer";
>
> mail($email,$subject,$message,$headers);
>
> the $email variable is declared outside this code. And works fine.
>
> Regards,
>
> Hush
One more issue is that you may not have checked your spam folders.
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 13:48:54 von flowover
On Jan 5, 4:46 am, flowover wrote:
> On Jan 5, 3:32 am, Hush wrote:
>
>
>
> > Hi,
>
> > php beginner here...
> > I'm having some trouble sending mail with php to hotmail/gmail
> > accounts. Other domains work fine (recieved email after 2 minutes).
> > Hotmail accounts do not receive the mail at all.
>
> > Does anyone have any experience/solution to this issue?
>
> > My code is below:
>
> > $message = "Click this (exact) link for activation: $link";
> > $message = wordwrap($message, 70);
> > $headers = "From: supp...@xxx.com\n";
> > $headers .= "MIME-Version: 1.0\n";
> > $headers .= "Content-type: text/html; charset=iso-8859-1\n";
> > $headers .= "Reply-To: Support \n";
> > $headers .= "X-Priority: 1\n";
> > $headers .= "X-MSMail-Priority: High\n";
> > $headers .= "X-Mailer: My mailer";
>
> > mail($email,$subject,$message,$headers);
>
> > the $email variable is declared outside this code. And works fine.
>
> > Regards,
>
> > Hush
>
> One more issue is that you may not have checked your spam folders.
Sorry for the broken reply into many posts. I just noticed you have
no From: field in your headers. This could annoy spam filters. Reply-
to is one thing, but they may be looking for a valid From: that is the
same domain you are sending the mail from.
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 13:49:37 von Hush
> Gmail doesn't like carriage returns (\r) at all. This could be
> related? Here's a discussion I found regarding it.http://www.bigroom.co.uk/blog/php-mail-and-gmail
Hmm. Well \r isnt the problem, but I'm finding the article
interessting.
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 13:53:49 von luiheidsgoeroe
On Sat, 05 Jan 2008 13:48:54 +0100, flowover wro=
te:
> On Jan 5, 4:46 am, flowover wrote:
>> On Jan 5, 3:32 am, Hush wrote:
>> > php beginner here...
>> > I'm having some trouble sending mail with php to hotmail/gmail
>> > accounts. Other domains work fine (recieved email after 2 minutes).=
>> > Hotmail accounts do not receive the mail at all.
>>
>> > Does anyone have any experience/solution to this issue?
>>
>> > My code is below:
>>
>> > $message =3D "Click this (exact) link for activation: $link=
";
>> > $message =3D wordwrap($message, 70);
>> > $headers =3D "From: supp...@xxx.com\n";
>> > $headers .=3D "MIME-Version: 1.0\n";
>> > $headers .=3D "Content-type: text/html; charset=3Diso-8859-=
1\n";
>> > $headers .=3D "Reply-To: Support \n";
>> > $headers .=3D "X-Priority: 1\n";
>> > $headers .=3D "X-MSMail-Priority: High\n";
>> > $headers .=3D "X-Mailer: My mailer";
>>
>> > mail($email,$subject,$message,$headers);
>>
>> > the $email variable is declared outside this code. And works fine.
>>
>> > Regards,
>>
>> > Hush
>>
>> One more issue is that you may not have checked your spam folders.
>
> Sorry for the broken reply into many posts. I just noticed you have
> no From: field in your headers. This could annoy spam filters. Reply=
-
> to is one thing, but they may be looking for a valid From: that is the=
> same domain you are sending the mail from.
He has.....
Hotmail is notoriously difficult BTW, so check all servers for possible =
=
blacklisting, and there is some page @ hotmail where you can assure them=
=
you're not sending spam. If only I could remember/find the url somewhere=
....
-- =
Rik Wasmus
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 14:00:22 von Hush
> Sorry for the broken reply into many posts. I just noticed you have
> no From: field in your headers. This could annoy spam filters. Reply-
> to is one thing, but they may be looking for a valid From: that is the
> same domain you are sending the mail from.
No problem:)
I have a From in my header:
$headers = "From: supp...@xxx.com\n";
....
Kenny
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 14:01:06 von Hush
> Hotmail is notoriously difficult BTW, so check all servers for possible
> blacklisting, and there is some page @ hotmail where you can assure them
> you're not sending spam. If only I could remember/find the url somewhere...
My search has begun:)
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 14:09:44 von flowover
On Jan 5, 5:00 am, Hush wrote:
> > Sorry for the broken reply into many posts. I just noticed you have
> > no From: field in your headers. This could annoy spam filters. Reply-
> > to is one thing, but they may be looking for a valid From: that is the
> > same domain you are sending the mail from.
>
> No problem:)
>
> I have a From in my header:
>
> $headers = "From: supp...@xxx.com\n";
>
> ...
>
> Kenny
Sorry I'm blind.
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 14:13:52 von Hush
> Hotmail is notoriously difficult BTW, so check all servers for possible
> blacklisting, and there is some page @ hotmail where you can assure them
> you're not sending spam. If only I could remember/find the url somewhere...
My domain is new and hasn't aired yet, so could this still be an
issue?
Hush
Re: Problem using mail() when sending to hotmail/gmail...
am 05.01.2008 16:44:53 von support.com2learn
The problem was that the host was blacklisted.
Solution:
I'm sending the mail through a different server that I own.
Thanks for the help.
Hush