Email logic not working


Posted on 16th Feb 2014 07:03 pm by admin

I would like to send an email using the php email() function then if it does execute i.e sends i would like to update a particular field in my db.however no matter how hard i try to the code seem to defy simply logic.here is the original code i have Code:
include_once("mailer.php");

$thesend=mail($toto1,$subject1,$message,$headers);
Did you know?Explore Trending and Topic pages for more stories like this.

if($thesend)
{
$mail_went=1;
$_SESSION['msgstatus']= "Mail sent to ".$toto1."
";

}else{
$mail_went=0;
$_SESSION['msgstatus']= "Mail send failure - message not sent
";

}
the funny part is that the code executes the else and actually gives me the Mail send failure message yet i do receive the mail in my box????
However if i do change this to be like this Code: include_once("mailer.php");

$thesend=mail($toto1,$subject1,$message,$headers);

if(!$thesend)
{
$mail_went=1;
$_SESSION['msgstatus']= "Mail sent to ".$toto1."
";

}else{
$mail_went=0;
$_SESSION['msgstatus']= "Mail send failure - message not sent
";

}
........all works perfect what am i missing.The $message is an HTMl doc and the MIME and content-type are ok.
Damn
No comments posted yet

Your Answer:

Login to answer
243 Like 36 Dislike
Previous forums Next forums
Other forums

Login Control?!
I have a Web Site that uses the login control also I have set the destinationurl to the page I want

Conditions of info record - Error
When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but

PHP Multiples of 2, Show posts...not working (wordpress)
I have been using this code to show div.example with 6 li columns inside it, each li is a post with

try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called

Firewall / visited websites logger
Hi. I have a firewall implementation and I want to log all the websites visited on the machine. S

Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo

Get word number x from string?
How can I use a function to loop through a string, and "have a look at" every word in the

IIS & NW MII on the same server
Hi,

We're weighing the possibility to run both IIS and MII (NetWeaver) on the same server

Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interes

Does deleting the spmlog directory critical?
Hi Everyone,

Please, hope you could help me. We're having problems with the SAP backup. I

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