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
23
Other forums
Problem in back link
I have page where i have given javascript back link but when i click on it browser give a message
Count
Getting the same count everytime
Code:
$visitquery = mysql_query("SELECT COUNT(*) FR
Character Set Setup
Whats the best character set to use if you want every character to work, and also how do you make yo
Add weeks in a query?
I have a SQL that summarizes the quantity per week. The weeks that has no value does not exist in th
Need help making a blockquote and line items conditional
I have some code I bought a few years ago that allows my clients to update content on their site usi
Delete records not in top 15
Hi,
I'm creating a hall of fame page in my game and the page will only display the top 15 sco
this code is not working????
it says this error.. Warning: Division by zero in ..
the variables are correct, so why is th
Need help to identify this error please
:confused:Can anyone help me tell what this error message means? Maybe tell me where to look to fix
fopen() security
As i understood the usage of fopen() for it to function correctly the Dir you write to has to be rw
if statements problems
Hi. I'm trying to make a web form, but I kind of hit a dead end trying to figure out why it doesn't