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
Any decent php formatter/beautifier/pretty printer?
Any decent php formatter/beautifier/pretty printer class/function?
I found the following whil
Feed Maker
Hi all.
First of all I must say I am not a php developer so I am afraid I don't know much about i
Referential Integrity problem when inserting into 2 tables at same time
Hello Everyone,
Im relativity new to PHP and MySQL and i have come up against a problem. i h
Batch Session SM35 stuck in status 'in Background
Hi Experts,
I am facing a problem with Batch Input session SM35.
The batch se
Track downloads' status
Hello,
I need to make somehow, some system, to track whether downloads are completed or faile
Specific name typed, specific image shown on html page
Hello,
Fairly new to PHP and was curious if someone might know how to solve a fairly simple r
phpmailer class & pop.gmail.com?
Code: <?php
$mail->IsSMTP();
$mail->Host = "pop.gmail.com";
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.
session_destroy();
new to php
I have a simple login and am trying to write a logout.
I set a $_SESSION var to 1 i
fopen() security
As i understood the usage of fopen() for it to function correctly the Dir you write to has to be rw