| Index
» Projects
» phpMyEdit
» Forum
» mail problem |
 |
vmenonus@yahoo.com
Joined: 09 Nov 2008
Posts: 1
Posted: 2008-11-09 20:05
Back to top
Reply with quote
|
I have this code , which is not sending mails.
It is printing values of email address I selected from another form . So _POST and implode is getting values and also "Success" message comes on the screen but I never gets mail.
When I hard code an email id on mail , I gets mail.
Can some one help ?
<?php
error_reporting(E_ALL);
$toSend = implode(",",$_POST['sendmail']);
$toSubject = $_POST['subject'];
$toMessage = $_POST['message'];
$headers = "From: AIM";
print $toSend;
print "<br>";
if($sent = mail($toSend,$toSubject,$toMessage)){
{print "Your mail was sent successfully"; }
}else{
{print "We encountered an error sending your mail"; }
}
?>
|
cbek
Joined: 25 Oct 2008
Posts: 27
Posted: 2008-11-09 21:25
Back to top
Reply with quote
|
| vmenonus@yahoo.com wrote: |
I have this code , which is not sending mails.
It is printing values of email address I selected from another form . So _POST and implode is getting values and also "Success" message comes on the screen but I never gets mail.
When I hard code an email id on mail , I gets mail.
Can some one help ?
<?php
error_reporting(E_ALL);
$toSend = implode(",",$_POST['sendmail']);
$toSubject = $_POST['subject'];
$toMessage = $_POST['message'];
$headers = "From: AIM";
print $toSend;
print "<br>";
if($sent = mail($toSend,$toSubject,$toMessage)){
{print "Your mail was sent successfully"; }
}else{
{print "We encountered an error sending your mail"; }
}
?> |
You need to add the header in the Mail function!
|
|
Post new topic
Reply to topic
|
|
|
|