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);

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

Problems with array
This code is the last lines in an upload script that uploads 4 images at the same time and writes th

ereg_replace issue
hi there people

i have this code happening with regards to my wamp server. is this something

Trouble with a select list
Hello All!
I was wondering if any of you guys could help me with a small problem I'm having!

Taking an HTML form and a PHP program and making it into one working file.
Hello,

So I would like to display everything INSIDE a specific directory. In other words, I

need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code.

curl javascript problem
Hi Experts.
I'm new curl and wanna to get some info from this http://www.amadeus.net/

when

Problem with "dynamic" index page
Hi. I have one question. In my index.php page I have this kind of code:
Code: // listaa sivut

Why does my php page download images over and over
Can anybody please explain to me why my php page keeps downloading the images and other items every

puting for loop in 1 value
hi ,

how do i put this code in 1 value:
Code: <?php
for ($i=1; $i<=5; $i

error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an

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