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

$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 Like 23 Dislike
Previous forums Next forums
Other forums

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

division gives infinity anser
int main()
{
int z=0;
int i=1/z;
cout<
}

It doesn't throw a

Comment Mod System Effects all rows...
Sorry if its confusing but here is whats going on: I have a table in a database called comments and

Search with relational database
Hey,

I have quite a complicated (for me anyway ) relational database for an apartments syste

insert/update functions for mysql, what do you think?
I am working on two really simple functions that automatically generate (and execute) insert and upd

Points for Wiki contribution
Hi everyone,

I want to know how long does it take for the moderator to award points for a

How do I replace any number of character occurences with one occurrence?
How do I replace any number of character occurences with one occurrence?

Let's say I have:

Required to login help
I'm trying to set up my site so users have to be logged into the forum to access the site.I've been

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash