Email Script does not reach destination


Posted on 16th Feb 2014 07:03 pm by admin

Hey Guys look at this code snippet :
Code:
//read a line from the file

$myFile = "MailFile.txt";
$fh = fopen($myFile, 'r');
$theData = fgets($fh);
fclose($fh);
echo $theData;

/send Email
$to = "'$theData'";
$subject = "AvailPay new customer Transaction Receipt";
//$message = "Welcome to AvailPay© .rnPlease keep this for your recordsrnBelow is your transaction information:rn";

$message = "welcome";

if (mail($to, $subject, $message)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}



I'm reading a file and then using that line as the email address.
I get the "Message successfully sent!" reply - but for some reason the email never arrived at the gmail destination, I also tried it with a yahoo email - same result.

The hosting service said the following:

If you use the mail() function in your PHP, you do not need to specify an outgoing mail server. If you are using some other method besides mail() in your PHP code, use relay-hosting.secureserver.net for your relay server.


I'm using the mail() function, but for some reason the email is not getting to the destination. How would I use the relay-hosting.secureserver.net in PHP??? Or am I missing something. Thanks in advance.

No comments posted yet

Your Answer:

Login to answer
241 Like 23 Dislike
Previous forums Next forums
Other forums

Reditecting pages based on logic
Newbie here, apologies in advance!

I am trying to use the header function to forward one of a

send() and recv() parameters confusion
On server Side:
int recv (Socket,Buffer, Length, Flags)
On Client Side:
int send (Soc

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

Help with parsing this html
Hi,
I've got some html i just need a couple of strings from.. argh, it's freaking me out. I've t

PHP Upload issue
Hi guys,

I have stumble across an interesting issue with my script and is doing my head in.

PHP form help required
Hi all! Apologies in advance for having to message the forum for help. I know you must get a lot of

Converting RGB values to HEX
Code: <?PHP

$file_handle = fopen("colors/rgb.csv", "r");

wh

Check Digits and extracting digits
I think I can figure out the code for this but I am having a very hard time getting past the first s

PHP - HTTP Digest Authentication - Understanding Code Help
Hi Everyone,

This is my first time on your website and please excuse if I am asking silly que

WHYISNT THIS MYSQL STATEMNT NOT WORKING? (php)
caps because its absolutely rediculous.
i dontunderstand why its not working. there is a column c

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash