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
23
Other forums
please, need help coding this voting for your favorite car polling system.
hi, my code needs a lot of work, but i want to be able to let users vote on their favorite car, upda
array help
Does anyone know how to require 10 text fields for individual grades and output class average? (10 p
simple php table loop
Hi all,
I've the following code
<?php // Create category options
Procedural to OOP
John Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pr
Just a white page
Okay so, my website, when I click SignUp on it it takes me to /join.php but its a complete white pag
Posting to another Site?
I have software that people install.
When they install it, is there a way to make it post their d
Unable to display contents in Second Drop Down Box
Hi All,
What I am trying to do is 2 dependent drop down boxes and when user selects su
problem when runing a funciton
I am trying to connect to database using a funciton in a functions.php
<?php
funct
JQuery, Masterpage, and Control issue
Hey everyone, I am using JQuery in several sites so I thought it would be best to place the library
Get to know your fellow coder
I think it's time we got personal around here. There's a lot of code swapping and a few members kno