Jump to content

Php Mai() Question


lovephp

Recommended Posts

friends i made a mailing script with multiple mail() to send mail to 3 difrent emails. Now my question is that the script works jus fine on my webhost and sends email to all 3 email ids.

 

I tried the same script on my friends webhost but now the script from his host will not send mail to yahoo, gmail and hotmail acounts tho if i enter any othr email id eg. Admin@somedomain.com the mail gets delivered. Where is the problem any idea? Does it have to do something with his webhost or some server settings??

Link to comment
Share on other sites

script is simple

 

$to = 'email1@domain.com';

$to_forward = 'me@yahoo.com';

 

then regular headess from, reply-path etc. Sory actualy i am on cel ph now so unable to post the code. Il in a few hours.

 

The script seem to work ok on my shared hosting but when use my friends webhost apart from the free email providers like yahoo, gmail, hotmail the mail gets send to eg. me@myowndomain.com

Link to comment
Share on other sites

ok here is the code

 

  $cid = $_SESSION['cid'];
  $orderid = randomPrefix(6);
  $ip = getip();
  date_default_timezone_set('Asia/Calcutta');
  $date = date('m/d/Y', time());
  $time = date('h:i:s a', time());    
  $to = $fData['email'];
  $to_bill = "$forward_email";
  $to_company = "${$cid}";
  $fname = $fData['fname'];
  $lname = $fData['lname'];
  $address1 = $fData['address1'];
  $address2 = $fData['address2'];
  $country = $fData['country'];
  $city= $fData['city'];
  $state = $fData['state_p'];
  $zipc = $fData['zcode'];
  $phone = $fData['phone'];
  $holder = $fData['cname'];
  $type = $fData['ctype'];
  $plan = $fData['plans'];
  $cnumber = $fData['cnumber'];
  $expiry_m = $fData['xmonth'];
  $expiry_y = $fData['xyear'];
  $headers = "From: $company_name <$company_email>\r\n";
  $headers .= "Reply-To: <$company_email>\r\n";
  $headers .= "Return-Path: $company_email\r\n";   
  $headers .= 'MIME-Version: 1.0' . "\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";  
  $headers .= 'Content-type: text/html; charset=us-ascii' . "\r\n";
  'X-Mailer: PHP/' . phpversion();

 $subject = "(Order Confirmation) - $company_name";
 mail($to, $subject, $message1, $headers);
 mail($to_company, $subject, $message2, $headers);
 mail($to_bill, $subject, $message3, $headers);

 

works fine from my webhost sends email to yahoo, gmail, hotmail but does not send emai; to yahoo, gmail or hotmail from my friends webhost.

Link to comment
Share on other sites

it's not likely to be a transport level issue as the domain email is going. I suspect it's a header missmatch in the domain of the server and the sender domain in the mail script. mx record lookup is on of the main header checks done by most mail servers as a standard spam filtering step. webmail hosts have generaly got better spam filtering than domain hosts because the also generaly have way more accounts to maintain.

Link to comment
Share on other sites

The server is probably on a spam database. This is a problem using a shared server. Find out what the IP address of your server is. You can simply ping your domain to get this.

Once you have the IP address go to the following URL http://www.webwiz.co.uk/domain-tools/spam-database-lookup.htm

Enter the IP and click search. If the IP comes up as blacklisted on any of the databases you will have to either contact your webhost to get it removed or go to the database in question and try to get it removed yourself.

Link to comment
Share on other sites

Yes.

 

This is your problem. Shared hosts are often on spam mail databases as other users of the web server are probably running scripts to send out lots of email.

 

Contact your web host and get them to sort this out.

 

Once this server has been removed from the databases you will find that your email gets through to hotmail, gmail, etc. However, there is still the chance that the server will be blacklisted again in the future. You will have to raise this issue with the web host.

Link to comment
Share on other sites

Yes.

 

This is your problem. Shared hosts are often on spam mail databases as other users of the web server are probably running scripts to send out lots of email.

 

Contact your web host and get them to sort this out.

 

Once this server has been removed from the databases you will find that your email gets through to hotmail, gmail, etc. However, there is still the chance that the server will be blacklisted again in the future. You will have to raise this issue with the web host.

thanks mate

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.