473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

mail() not reaching hotmail

Hello everyone,

I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I receive
the message on my website's email account, but it never reaches my
hotmail account.

Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:

<?php

$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'w**************@hotmail.com';
$headers = "From: working_address@this_domain.com";

mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";

mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";

?>

Jun 5 '07 #1
12 4548
Tom
<e_*******@hotmail.comwrote in message
news:11**********************@z28g2000prd.googlegr oups.com...
Hello everyone,

I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I receive
the message on my website's email account, but it never reaches my
hotmail account.

Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:

<?php

$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'w**************@hotmail.com';
$headers = "From: working_address@this_domain.com";

mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";

mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";

?>
If you are really using that header, the "other_domain.com" domain isn't
showing up as a valid domain and most current mail systems will reject mail
from bogus addresses.

Tom
--
Newsguy.com
90+ Days Retention
99% Article Completion
Can Now Create Your Own NZB Files
Jun 5 '07 #2
On Jun 5, 8:53 am, "Tom" <t...@to.comwrote:
<e_matt...@hotmail.comwrote in message

news:11**********************@z28g2000prd.googlegr oups.com...
Hello everyone,
I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I receive
the message on my website's email account, but it never reaches my
hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";
?>

If you are really using that header, the "other_domain.com" domain isn't
showing up as a valid domain and most current mail systems will reject mail
from bogus addresses.

Tom
--
Newsguy.com
90+ Days Retention
99% Article Completion
Can Now Create Your Own NZB Files
Those are all working addresses, I just wrote dummy addresses for this
posting:

working_address@other_domain.com - an address at my established site;
wo*************@hotmail.com - a working hotmail address;
working_address@this_domain.com - an address on the new site.

Jun 5 '07 #3

<e_*******@hotmail.comwrote in message
news:11**********************@z28g2000prd.googlegr oups.com...
Hello everyone,

I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I receive
the message on my website's email account, but it never reaches my
hotmail account.

Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:

<?php

$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'w**************@hotmail.com';
$headers = "From: working_address@this_domain.com";

mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";

mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";

?>

I think there are some issues with mail(). I'm not sure if thats your
problem but I ran across a few bugs that it has when I was trying to figure
out how to mail. They say the pear mail package is much better than this.

The code I used for testing works fine for hotmail

<?php
echo "Sending Mail...<br/>\n";
$to = 't*******@hotmail.com'; // changed
$subject = 'test';
$message = 'hello';
$headers = 'From: we*******@example.com' . "\r\n" . // Not changed... just
crap addr but works
'Reply-To: we*******@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers) ? print "Sent mail!" : print "Cannot
send mail";;
?>

You might look at that and see the differences. (as you can see, it uses the
"\r\n" and some extra info that you might see if it matters or not)

Jun 5 '07 #4
On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.comwrote:
<e_matt...@hotmail.comwrote in message

news:11**********************@z28g2000prd.googlegr oups.com...
Hello everyone,
I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I receive
the message on my website's email account, but it never reaches my
hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";
?>

I think there are some issues with mail(). I'm not sure if thats your
problem but I ran across a few bugs that it has when I was trying to figure
out how to mail. They say the pear mail package is much better than this.

The code I used for testing works fine for hotmail

<?php
echo "Sending Mail...<br/>\n";
$to = 'testa...@hotmail.com'; // changed
$subject = 'test';
$message = 'hello';
$headers = 'From: webmas...@example.com' . "\r\n" . // Not changed... just
crap addr but works
'Reply-To: webmas...@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers) ? print "Sent mail!" : print "Cannot
send mail";;
?>

You might look at that and see the differences. (as you can see, it uses the
"\r\n" and some extra info that you might see if it matters or not)

I started receiving the messages on the hotmail account once I added
my domain to the safe list in hotmail. That's a step in the right
direction, but I'd like to figure out what's missing or incorrect
which makes it get filtered out. Any thoughts on required headers or
format for hotmail?

Jun 6 '07 #5
e_*******@hotmail.com wrote:
On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.comwrote:
><e_matt...@hotmail.comwrote in message

news:11**********************@z28g2000prd.googleg roups.com...
Hello everyone,
I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I receive
the message on my website's email account, but it never reaches my
hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";
?>

I think there are some issues with mail(). I'm not sure if thats your
problem but I ran across a few bugs that it has when I was trying to
figure out how to mail. They say the pear mail package is much better
than this.

The code I used for testing works fine for hotmail

<?php
echo "Sending Mail...<br/>\n";
$to = 'testa...@hotmail.com'; // changed
$subject = 'test';
$message = 'hello';
$headers = 'From: webmas...@example.com' . "\r\n" . // Not changed...
just crap addr but works
'Reply-To: webmas...@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers) ? print "Sent mail!" : print
"Cannot send mail";;
?>

You might look at that and see the differences. (as you can see, it uses
the "\r\n" and some extra info that you might see if it matters or not)


I started receiving the messages on the hotmail account once I added
my domain to the safe list in hotmail. That's a step in the right
direction, but I'd like to figure out what's missing or incorrect
which makes it get filtered out. Any thoughts on required headers or
format for hotmail?
So PHP's mail() DID work just fine.
If you configured hotmail to block anything except the domains in your 'safe
list', what do you expect?
No header will fix that, unless hotmail is broken.

Regards,
Erwin Moller
Jun 6 '07 #6
On Jun 6, 2:16 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
e_matt...@hotmail.com wrote:
On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.comwrote:
<e_matt...@hotmail.comwrote in message
>news:11**********************@z28g2000prd.googleg roups.com...
Hello everyone,
I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I receive
the message on my website's email account, but it never reaches my
hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";
?>
I think there are some issues with mail(). I'm not sure if thats your
problem but I ran across a few bugs that it has when I was trying to
figure out how to mail. They say the pear mail package is much better
than this.
The code I used for testing works fine for hotmail
<?php
echo "Sending Mail...<br/>\n";
$to = 'testa...@hotmail.com'; // changed
$subject = 'test';
$message = 'hello';
$headers = 'From: webmas...@example.com' . "\r\n" . // Not changed...
just crap addr but works
'Reply-To: webmas...@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers) ? print "Sent mail!" : print
"Cannot send mail";;
?>
You might look at that and see the differences. (as you can see, it uses
the "\r\n" and some extra info that you might see if it matters or not)
I started receiving the messages on the hotmail account once I added
my domain to the safe list in hotmail. That's a step in the right
direction, but I'd like to figure out what's missing or incorrect
which makes it get filtered out. Any thoughts on required headers or
format for hotmail?

So PHP's mail() DID work just fine.
If you configured hotmail to block anything except the domains in your 'safe
list', what do you expect?
No header will fix that, unless hotmail is broken.

Regards,
Erwin Moller

I didn't configure hotmail to block anything except the domains in my
'safe list'. I have never used the safe list option, and I've been
using this account for about 7 years with very little spam, and
without setting up custom spam filters.

When no test messages were getting through, I added my new domain to
the safe list to see if that would let the message through. It did,
but I don't want everyone to have to put me on their safe list to get
messages through. So what I'm looking for is a set of headers or
format that will let messages through on most standard settings.

Jun 6 '07 #7
e_*******@hotmail.com wrote:
On Jun 6, 2:16 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
> e_matt...@hotmail.com wrote:
On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.comwrote:
<e_matt...@hotmail.comwrote in message
>>news:11**********************@z28g2000prd.google groups.com...
Hello everyone,
I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on
different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I
receive the message on my website's email account, but it never
reaches my hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same
results
- reaches my website's email account, but not my hotmail account.
The code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";
?>
>I think there are some issues with mail(). I'm not sure if thats your
problem but I ran across a few bugs that it has when I was trying to
figure out how to mail. They say the pear mail package is much better
than this.
>The code I used for testing works fine for hotmail
><?php
echo "Sending Mail...<br/>\n";
$to = 'testa...@hotmail.com'; // changed
$subject = 'test';
$message = 'hello';
$headers = 'From: webmas...@example.com' . "\r\n" . // Not changed...
just crap addr but works
'Reply-To: webmas...@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
>mail($to, $subject, $message, $headers) ? print "Sent mail!" : print
"Cannot send mail";;
?>
>You might look at that and see the differences. (as you can see, it
uses the "\r\n" and some extra info that you might see if it matters
or not)
I started receiving the messages on the hotmail account once I added
my domain to the safe list in hotmail. That's a step in the right
direction, but I'd like to figure out what's missing or incorrect
which makes it get filtered out. Any thoughts on required headers or
format for hotmail?

So PHP's mail() DID work just fine.
If you configured hotmail to block anything except the domains in your
'safe list', what do you expect?
No header will fix that, unless hotmail is broken.

Regards,
Erwin Moller


I didn't configure hotmail to block anything except the domains in my
'safe list'. I have never used the safe list option, and I've been
using this account for about 7 years with very little spam, and
without setting up custom spam filters.
Ok clear. I didn't know that.
(Never used hotmail)

Some mailservers are extremely picky when it comes to headers.
You could try to add a few, like:
Return-Path
Meassage-ID

Maybe that helps. :-/

Good luck.
Erwin Moller

PS: A guy named Gordon Burditt frequents this group and knows a lot more
about mailprotocols than I do. Maybe contact him. :-)

Jun 6 '07 #8
On Jun 6, 9:29 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
e_matt...@hotmail.com wrote:
On Jun 6, 2:16 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
e_matt...@hotmail.com wrote:
On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.comwrote:
<e_matt...@hotmail.comwrote in message
>news:11**********************@z28g2000prd.googleg roups.com...
Hello everyone,
I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on
different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I
receive the message on my website's email account, but it never
reaches my hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same
results
- reaches my website's email account, but not my hotmail account.
The code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";
?>
I think there are some issues with mail(). I'm not sure if thats your
problem but I ran across a few bugs that it has when I was trying to
figure out how to mail. They say the pear mail package is much better
than this.
The code I used for testing works fine for hotmail
<?php
echo "Sending Mail...<br/>\n";
$to = 'testa...@hotmail.com'; // changed
$subject = 'test';
$message = 'hello';
$headers = 'From: webmas...@example.com' . "\r\n" . // Not changed...
just crap addr but works
'Reply-To: webmas...@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers) ? print "Sent mail!" : print
"Cannot send mail";;
?>
You might look at that and see the differences. (as you can see, it
uses the "\r\n" and some extra info that you might see if it matters
or not)
I started receiving the messages on the hotmail account once I added
my domain to the safe list in hotmail. That's a step in the right
direction, but I'd like to figure out what's missing or incorrect
which makes it get filtered out. Any thoughts on required headers or
format for hotmail?
So PHP's mail() DID work just fine.
If you configured hotmail to block anything except the domains in your
'safe list', what do you expect?
No header will fix that, unless hotmail is broken.
Regards,
Erwin Moller
I didn't configure hotmail to block anything except the domains in my
'safe list'. I have never used the safe list option, and I've been
using this account for about 7 years with very little spam, and
without setting up custom spam filters.

Ok clear. I didn't know that.
(Never used hotmail)

Some mailservers are extremely picky when it comes to headers.
You could try to add a few, like:
Return-Path
Meassage-ID

Maybe that helps. :-/

Good luck.
Erwin Moller

PS: A guy named Gordon Burditt frequents this group and knows a lot more
about mailprotocols than I do. Maybe contact him. :-)
Thanks, I'll look out for him. In the mean time, I'll post a message
like most other sites do that if the user doesn't receive initial
messages, to check their spam filter settings. I'll also play around
with headers, starting with the ones you suggested.

Jun 6 '07 #9
Tom

<e_*******@hotmail.comwrote in message
news:11**********************@n15g2000prd.googlegr oups.com...
On Jun 5, 8:53 am, "Tom" <t...@to.comwrote:
<e_matt...@hotmail.comwrote in message

news:11**********************@z28g2000prd.googlegr oups.com...
Hello everyone,
I am trying to use the mail() function to send a simple, text-only
message. I have two websites hosted by the same company, on different
servers. One is old and established, one I am currently developing.
I am testing the mail functionality by sending a test message to an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I receive
the message on my website's email account, but it never reaches my
hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not deliver
to $address2.";
print "Done with $address2.<br>";
?>
If you are really using that header, the "other_domain.com" domain isn't
showing up as a valid domain and most current mail systems will reject
mail
from bogus addresses.

Tom
--
Newsguy.com
90+ Days Retention
99% Article Completion
Can Now Create Your Own NZB Files

Those are all working addresses, I just wrote dummy addresses for this
posting:

working_address@other_domain.com - an address at my established site;
wo*************@hotmail.com - a working hotmail address;
working_address@this_domain.com - an address on the new site.
Can understand the need for doing that. : )

If you haven't done it already, I'd try sending the same exact email from a
desktop mail application and see if the results are any different. You might
get an error message from your SMTP server or the hotmail mail server that
may point to a problem.

If you aren't able to get an error back, you might need to check with
hotmail to see if they might be filtering something.

Tom
--
Newsguy.com
90+ Days Retention
Free SSL Connections
Create Your Own NZB Files
Jun 6 '07 #10

<e_*******@hotmail.comwrote in message
news:11**********************@z28g2000prd.googlegr oups.com...
On Jun 6, 9:29 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
> e_matt...@hotmail.com wrote:
On Jun 6, 2:16 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
e_matt...@hotmail.com wrote:
On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.com>
wrote:
<e_matt...@hotmail.comwrote in message
>>news:11**********************@z28g2000prd.google groups.com...
Hello everyone,
I am trying to use the mail() function to send a simple,
text-only
message. I have two websites hosted by the same company, on
different
servers. One is old and established, one I am currently
developing.
I am testing the mail functionality by sending a test message to
an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I
receive the message on my website's email account, but it never
reaches my hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same
results
- reaches my website's email account, but not my hotmail account.
The code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not
deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not
deliver
to $address2.";
print "Done with $address2.<br>";
?>
>I think there are some issues with mail(). I'm not sure if thats
your
problem but I ran across a few bugs that it has when I was trying
to
figure out how to mail. They say the pear mail package is much
better
than this.
>The code I used for testing works fine for hotmail
><?php
echo "Sending Mail...<br/>\n";
$to = 'testa...@hotmail.com'; // changed
$subject = 'test';
$message = 'hello';
$headers = 'From: webmas...@example.com' . "\r\n" . // Not
changed...
just crap addr but works
'Reply-To: webmas...@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
>mail($to, $subject, $message, $headers) ? print "Sent mail!" :
print
"Cannot send mail";;
?>
>You might look at that and see the differences. (as you can see, it
uses the "\r\n" and some extra info that you might see if it
matters
or not)
I started receiving the messages on the hotmail account once I added
my domain to the safe list in hotmail. That's a step in the right
direction, but I'd like to figure out what's missing or incorrect
which makes it get filtered out. Any thoughts on required headers
or
format for hotmail?
>So PHP's mail() DID work just fine.
If you configured hotmail to block anything except the domains in your
'safe list', what do you expect?
No header will fix that, unless hotmail is broken.
>Regards,
Erwin Moller
I didn't configure hotmail to block anything except the domains in my
'safe list'. I have never used the safe list option, and I've been
using this account for about 7 years with very little spam, and
without setting up custom spam filters.

Ok clear. I didn't know that.
(Never used hotmail)

Some mailservers are extremely picky when it comes to headers.
You could try to add a few, like:
Return-Path
Meassage-ID

Maybe that helps. :-/

Good luck.
Erwin Moller

PS: A guy named Gordon Burditt frequents this group and knows a lot more
about mailprotocols than I do. Maybe contact him. :-)

Thanks, I'll look out for him. In the mean time, I'll post a message
like most other sites do that if the user doesn't receive initial
messages, to check their spam filter settings. I'll also play around
with headers, starting with the ones you suggested.
If you do find the problem and solution post it here so we'll have a record
of it incase someone else runs into it too.

Jon
Jun 6 '07 #11
Tom says...
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same results
- reaches my website's email account, but not my hotmail account. The
code I am using to test is:
If you aren't able to get an error back, you might need to check with
hotmail to see if they might be filtering something.
Not sure about Hotmail, but I had a similar problem with the spam
filtering on another service (Gmail?, can recall).

The standard PHP mail() function can set the sender address in the header
to be different from the canonical sender address in your server's SMTP
settings.

Try using the optional fifth mail() parameter.

$to = 's******@hotmail.com';
$subject = 'Blah';
$message = 'Blah, blah';
$headers = '';
$params = '-f<insert a known real sender email address here>';

mail($to, $subject, $message, $headers, $params);

Geoff M
Jun 6 '07 #12
On Jun 6, 10:44 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.comwrote:
<e_matt...@hotmail.comwrote in message

news:11**********************@z28g2000prd.googlegr oups.com...
On Jun 6, 9:29 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
e_matt...@hotmail.com wrote:
On Jun 6, 2:16 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
e_matt...@hotmail.com wrote:
On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.com>
wrote:
<e_matt...@hotmail.comwrote in message
>news:11**********************@z28g2000prd.googleg roups.com...
Hello everyone,
I am trying to use the mail() function to send a simple,
text-only
message. I have two websites hosted by the same company, on
different
servers. One is old and established, one I am currently
developing.
I am testing the mail functionality by sending a test message to
an
email account associated with my old website, and to my hotmail
account. The message seems to be sent to both accounts, and I
receive the message on my website's email account, but it never
reaches my hotmail account.
Are there any special headers required for hotmail? I've looked
around a bit, and can't seem to figure it out. I've even tried
including several different headers, but always with the same
results
- reaches my website's email account, but not my hotmail account.
The code I am using to test is:
<?php
$body = 'Hello from the internet mail tubes!';
$subject = 'Test message';
$address = 'working_address@other_domain.com';
$address2 = 'working_addr...@hotmail.com';
$headers = "From: working_address@this_domain.com";
mail($address, $subject, $body, $headers) or print "Can not
deliver
to $address.";
print "Done with $address.<br>";
mail($address2, $subject, $body, $headers) or print "Can not
deliver
to $address2.";
print "Done with $address2.<br>";
?>
I think there are some issues with mail(). I'm not sure if thats
your
problem but I ran across a few bugs that it has when I was trying
to
figure out how to mail. They say the pear mail package is much
better
than this.
The code I used for testing works fine for hotmail
<?php
echo "Sending Mail...<br/>\n";
$to = 'testa...@hotmail.com'; // changed
$subject = 'test';
$message = 'hello';
$headers = 'From: webmas...@example.com' . "\r\n" . // Not
changed...
just crap addr but works
'Reply-To: webmas...@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers) ? print "Sent mail!" :
print
"Cannot send mail";;
?>
You might look at that and see the differences. (as you can see, it
uses the "\r\n" and some extra info that you might see if it
matters
or not)
I started receiving the messages on the hotmail account once I added
my domain to the safe list in hotmail. That's a step in the right
direction, but I'd like to figure out what's missing or incorrect
which makes it get filtered out. Any thoughts on required headers
or
format for hotmail?
So PHP's mail() DID work just fine.
If you configured hotmail to block anything except the domains in your
'safe list', what do you expect?
No header will fix that, unless hotmail is broken.
Regards,
Erwin Moller
I didn't configure hotmail to block anything except the domains in my
'safe list'. I have never used the safe list option, and I've been
using this account for about 7 years with very little spam, and
without setting up custom spam filters.
Ok clear. I didn't know that.
(Never used hotmail)
Some mailservers are extremely picky when it comes to headers.
You could try to add a few, like:
Return-Path
Meassage-ID
Maybe that helps. :-/
Good luck.
Erwin Moller
PS: A guy named Gordon Burditt frequents this group and knows a lot more
about mailprotocols than I do. Maybe contact him. :-)
Thanks, I'll look out for him. In the mean time, I'll post a message
like most other sites do that if the user doesn't receive initial
messages, to check their spam filter settings. I'll also play around
with headers, starting with the ones you suggested.

If you do find the problem and solution post it here so we'll have a record
of it incase someone else runs into it too.

Jon

I looked up posts from Gordon, and that was very helpful. I started
using the pear:mail package, which did not fix things right away. I
found that this combination of headers seems to work:

$this->headers['Subject'] = 'Test Subject';
$this->headers['From'] = "ac***********@myDomain.com";
$this->headers['Return-Path'] = "sa***************@mydomain.com";
$this->headers['X-Priority'] = "3";

Thanks everyone for the help.

Jun 7 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tom Petersen | last post by:
Hello The code itself is working, this is more of a cosmetic thing for me... lets say objRS("memail") = tom.petersen@aol.com strEmail = objRS("memail") & ";bill.clinton@aol.com" Mail.CC=...
1
by: leo | last post by:
Hello guys I have a problem when reaching the end of file (EOF). Is there any way I can start at the beggining of file (BOF) when looped second time sample code <% Do While Not rstA.EOF
1
by: Przemyslaw Wegrzyn | last post by:
Hi ! Can anyone here recommend good e-mail parsing library ? I have to write a program that scans e-mail message piped to it on STDIN. Most libraries I've found parses e-mail from file building...
10
by: herbert | last post by:
I am a hotmail user. 1) How do I send e-mail from my .NET 2.0 app via hotmail? How should the following lines look like? Assume my hotmail username is HMUN, my hotmail password is HMPW. Dim...
4
by: RedMoosh | last post by:
we have to mass email around 3000 to 10000 emails to clients with attachments. can i use system.net.mail to accomplish this task from the server? all my info is in a csv format along with paths...
1
by: Jayachandran | last post by:
Hi, All the mails r receiving, but the mails from yahoo.co.in. The mail is reaching upto the mail server but the mail is not reaching the particular mail id. Pls suggest wat to do. Looking...
5
usafshah
by: usafshah | last post by:
hi i'm using php mail (running on windows 2003 server <built-in smtp> ) to send email to abc.com domain, the email is not reaching to the domain as i'm monitoring it. but as i run the script i...
4
by: paldns | last post by:
HI , I moved my website to new server so sending mail stop working -I got no error when sending mail but no results -smtp service is running .. i telnet smtp.gmail.com 25 which work -I found...
5
by: Gordon | last post by:
I'm working on a reset password script for my CMS, that will generate a random password and email it to a user when they request one. The problem I am having is that the mails being sent out are...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.