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
DYNPRO_FIELD_CONVERSION
Hi gurus,
I got a dump when I run one of my program. the dump is described below:
How to copy a part of a vector in a raw memory
Hi,
How can I copy a part of a vector into a memory:
1
2
3
4
5
PHP url branch??
Functionally, using PHP, I'm doing a test of login input submitted by a user via an html form in a f
insert mysql embeded videos as blobs?
Using TinyMCE my client will be able to embed images and flash videos into large columns of text whi
first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see
ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th
problem with sql querry in php script
Hello guys,
What I want to do is I want to read out a csv file and then but te conent ot the
Changing color in GD via variable?
Hey guys, I'm new here. x)
I'm very much a noob when it comes to PHP, but I'm trying to learn
php is not recognized as an internal or external command
Hello,
I am trying to bake the code in CakePHP through my console.
I have changed my Path
How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<