Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail is not going through

Status
Not open for further replies.

mrtopher

Programmer
Aug 27, 2003
34
US
I have written a program that sends e-mail to people using the mail() function. I am including all the headers I can think of and yet I am getting reports that either people are not recieveing the message at all or they are being told that they have been sent e-mail from an untrusted source. And then there are people that get it just fine. I get the mail sent to my bulk mail folder through my e-mail provider.

Does anyone have any ideas on how to fix this problem?
 
Service providers can use any one of many methods to decide whether email is legit: SMTP header analysis, blackhole lists, whitehole lists, bayesian analysis of SMTP content, reverse DNS lookup on the sending server, ESMTP checks to see whether the sender's address or the reply-to address really exists.

It depends on the provider.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Thanks for the input. It really doesnt sound like there is a sure way to get the e-mail through. I was going to use this as a way to send out user login information to a program I created, but if the e-mail wont go through that wont work. Do you have any ideas on how I might send out user login information so that ppl will actually recieve it?
 
<?php
$to = &quot;yourplace@somewhere.com&quot;;
$subject = &quot;My HTML email test.&quot;;
$headers = &quot;From: myplace@here.com\r\n&quot;;
$headers .= &quot;Reply-To: myplace2@here.com\r\n&quot;;
$headers .= &quot;Return-Path: myplace@here.com\r\n&quot;;
$headers .= &quot;MIME-Version: 1.0\r\n&quot;;
$headers .= &quot;Content-Type: text/html; charset=ISO-8859-1\r\n&quot;;

$message = &quot;<html><body>&quot;;
$message .= &quot;<h1> This is a test </h1>&quot;;
$message .= &quot;</body></html>&quot;;

if ( mail($to,$subject,$message,$headers) ) {
echo &quot;The email has been sent!&quot;;
} else {
echo &quot;The email has failed!&quot;;
}
?>
 
lupin3's idea seems to work. I am still doing some testing, but from what I can tell the mail is getting to people now. The only addition to the headers that I was already sending was the Return-Path. I dont know why this works, but it works.

Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top