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
Did you know?Explore Trending and Topic pages for more stories like this.
$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
Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values
using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto
Structure Question - One Table or One Table Per Record Set?
I have a web app (mySQL and PHP) which allows people to create an item with up to 200 records which
PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see
Having a problem get the selected item from a drop down menu
I have been looking at this for days now.
I have a drop down menu that get it's values from a
Is there a quick way to do this?
Hi all,
I need to create a mysql table from php that goes a little something like this
Code clarification
Hi
In the following code what could be the "search_print()" and where it could be
PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.
Thanks!
Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.
what does this mean? +=
is anyone able to explain what this code is saying?
i had it written for me awhile back and n