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
How to limit the calls to an API
Hello, in my simple script I call an api which effectively involves me getting an xml file.
H
session checking in page load
hai all
I have a web site is www.Mryas.com in this my login page is Page1.aspx its co
How do i use vars in an array
Hiya peeps!
How do I use a var in an array. You will see $id but it isnt working.
Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the
PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo tho
I got my hosting suspended XD
So I saw this challenge a day or so ago
http://www.programming-challenges.com/pg.php?page=dow
RFQ Configuration - can you make PLANT field an optional field in ME42
Is there a way to make the plant field on an RFQ optional in change mode (ME42)?
Getting a variable to work in function params
I have this fuction which is inside a class:
Code: public static function generateEmbedCode($
Automatically Detect Phone Model for WAP Jar Deployment
Making a wap site is fairly simple, but I'd like to know if there's a way to make it so that the wap
How to make URL loads only on login
On my page, when a user login he's redirects to user_home.php. I made it also to open the chat scree