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
PHP FTP connect doesn't work with correct login
Hi!
i am working on this test code:
Quote<?php
$ftp_ser
Problem with HTML form
Hello,
I made a HTML form with some fields and check box.
Everything works fine except whe
that old Malformed Headers problem again!!!!! HELP!!!!!!
I've read the http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
I don't think my c
distinct rows
Hi
version 10.2.0.3
I have a query output something like the following
ID
Undefined Variable: PHP_SELF, pls help
Hi,
Im a newbie on PHP / MySQL programming and Im running a script to search one field on my
images aren't rendering
I'm trying to call a JPG file from within PHP (in an effort to hide the actual JPG folder). The imag
How do I send data using an html link
Hi
If I have
<a href="main_file.php">
How do I send data t
isset undefined variable
Hi all,
Hope someone can point out the obvious. I've a log in script, if you dont enter a use
Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data
Multi Level Array Problem
hi all,
For example I have array like below:
$temp = array(array('north america', 'us'