PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
yeah that works, even works with a variable in the, to, part, but if the bidy contains a variable it does not. What would happen instead of putting the $body variable in the mail finction, I was to put echo $body, same thing I imagine. It just does not like the contents of the body variable is my conclusion, what I can't seem to figure out...... I really don't want to use asp but I may be forced to here, and I really don't like asp, but have been ablr to make it work in the past -dustin
<?php
$ToEmail = "dustingarrett@yahoo.com";
$ToName = "Dustin";
$ToSubject = "New Remedy Motel Mailing List Entry";
$EmailBody = "'Sent By:' $FirstName 'Senders Email:' $Email 'Address:' $Address";
//$EmailFooter="This message was sent by: $FirstName If you feel that you
//recieved this e-mail by accident please contact us at http://www.whitedotgroup.com";
//$Message = $EmailBody
//.$EmailFooter;
if ( mail($ToName, $ToSubject, $EmailBody, "From: ".$FirstName." <".$Email.">") ) {
echo 'I worked';
} else {
echo 'I did not work';
}
Print "_Root.Mail.EmailStatus=Complete - Your mail has been sent";
?>
Try that...
Also, doing mail('string', 'etc', 'etc') doesn't work...it just doesn't throw up an error.
And, as a note, you only put an email into the email argument, not that funky brackets you had as well you had going on
OK- This is a step in the right direction, error checking is great, wish I would have come up with this earlier, or myself for that matter. Thanks. SO the above code is in action and I get this responce. Unfortunatly.
Warning: Bad Message destination in U:\users\r\remedy\pages\dust_mail.php on line 14
I did not work
So again I am not shure what to do.
This is the URL I am entering manually to get the results
<?php
$ToEmail = "dustingarrett@yahoo.com";
$ToName = "Dustin";
$ToSubject = "New Remedy Motel Mailing List Entry";
$EmailBody = "'Sent By:' $FirstName 'Senders Email:' $Email 'Address:' $Address";
//$EmailFooter="This message was sent by: $FirstName If you feel that you
//recieved this e-mail by accident please contact us at http://www.whitedotgroup.com";
//$Message = $EmailBody
//.$EmailFooter;
if ( mail($ToEmail, $ToSubject, $EmailBody, "From: ".$FirstName." <".$Email.">") ) {
echo 'I worked';
} else {
echo 'I did not work';
}
Print "_Root.Mail.EmailStatus=Complete - Your mail has been sent";
?>
Ooops, I had $ToName where there should have been $ToEmail.
Thank you so much... It has finally worked. Even from flash. The code does not seem all too different from the original code I was working with in the begining. When use use mail() do you have to use variables? Can you just enter text. ie mail("dustin@dustin.net", "subject", "Body text");... Anyhow I am ever so grateful for the help -Dustin