Jump to content

can't receive emails from script sometimes

Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

can't receive emails from script sometimes Rate Topic: -----

#1 User is offline   gab1982 

  • W.R. Corporal
  • Group: Members
  • Posts: 55
  • Joined: 24-February 07

Post icon  Posted 19 May 2009 - 11:49 AM

Ok this is a strange issue which has been ratling my brain for a few days for, i have a link which when clicked does a query and is suppost to send an email it sends an email but some servers can't receive the email and i don't know why.

$query2="SELECT settings.siteurl, settings.emailaddress, settings.sitename, landlords.id, landlords.email from settings, landlords WHERE landlords.id = '$id'";
				$server = $_SERVER['HTTP_HOST'];
				$host = ereg_replace('www.','',$server);
				$st=mysql_query($query2);
				$recs=mysql_num_rows($st);
				$row2=mysql_fetch_object($st);
				$sitename = str_replace("&", "&","$row2->sitename");
				
				$email = "".$row2->emailaddress."";
				$landlordsemail = "".$row2->email."";
				$subject = "".$sitename."";
				$headers = "From: $sitename <notifications@$host>\r\nReply-To: ".$sitename." <".$email.">\r\n";
											
				$message = "Your account with $sitename has now been activated, you can now login with your details:\n\n
Email address: $email\n

*** LANDLORDS LOGIN LINK *** \n
Landlords Login Link: ".$row2->siteurl."landlords-admin/index.php?step=1\n\n
If you have forgotten your password, you can change your password here: \n".$row2->siteurl."landlords-admin/forgotpassword.php
\n\n
Thank you.
$sitename\n
This is an automated response. Please do not reply!";
					
				mail($landlordsemail, $sitename, $message, $headers);


that is my email code but i can't figure out why should it send it to some servers but not to others, i checked the junk box on those servers which don't seem to be receiving the email but they aren't showing and i can't check the logs as i don't have route access, the query is working otherwise it wouldn't work at all but why should it work to some emails and not others, the emails it doesn't work with don't have any special characters other than the @ so are no different to the ones which do.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users