| Index
» Projekty
» phpMyEdit
» Fórum
» mail problem |
 |
vmenonus@yahoo.com
Založený: 09.11.2008
Príspevky: 1
Zaslal: 2008-11-09 20:05
Návrat hore
Odpovedať s citátom
|
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
Založený: 25.10.2008
Príspevky: 27
Zaslal: 2008-11-09 21:25
Návrat hore
Odpovedať s citátom
|
| vmenonus@yahoo.com Napísal: |
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!
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|