- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Community Moderator
- Author was Featured
- Bought between 10 and 49 items
- Referred between 200 and 499 users
- Has been a member for 4-5 years
- Won a Competition
<?php $senderName = $_POST['userName']; $senderEmail = $_POST['userEmail']; $senderMessage = $_POST['userMsg']; $emailAddress = $_POST['authorEmail']; $senderName = stripslashes($senderName); $senderEmail = stripslashes($senderEmail); $senderMessage = stripslashes($senderMessage); $emailAddress = stripslashes($emailAddress); $to = "$emailAddress"; $from = "$senderEmail"; $subject = "Email from your flipbook"; //Begin HTML Email Message $message = <<<EOF <htm?> <body bgcolor="#FFFFFF"> <b>Name</b>: $senderName<br /><br /> <b>Email</b>: $senderEmail<br /><br /> <b>Message</b>: $senderMessage<br /> </body> EOF; //end of message $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; $to = "$to"; mail( $to, $subject, $message, $headers); exit(); ?>
The code is pretty standard, any help will be great!
Try to use PHPMailer, it’s a great PHP library. http://phpmailer.worxware.com/ download the right version for you, and check the examples in library folder. 
Cheers
Laith
Could it be < htm? > << incorrect format ( I dont do php by the way )
Or user hasnt setup $emailAddress
Or sendmail function isnt installed on server, or incompatible version of php
- Author was Featured
- Beta Tester
- Bought between 10 and 49 items
- Community Moderator
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Exclusive Author
- Grew a moustache for the Envato Movember competition
- Has been a member for 4-5 years
The reason as to why it doesn’t work is probably because this client’s server has not been configured to use mail() correctly, i.e. the smtp details for a webserver email address have not been setup on the server by the host.
Try, as laith said, to use PHPMailer, which will allow you to send emails using any smtp credentials 
- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Community Moderator
- Author was Featured
- Bought between 10 and 49 items
- Referred between 200 and 499 users
- Has been a member for 4-5 years
- Won a Competition
Reaper-Media said
The reason as to why it doesn’t work is probably because this client’s server has not been configured to use mail() correctly, i.e. the smtp details for a webserver email address have not been setup on the server by the host. Try, as laith said, to use PHPMailer, which will allow you to send emails using any smtp credentials![]()
This is strange but I am trying with the PHPMailer with no luck ;/
- Author was Featured
- Beta Tester
- Bought between 10 and 49 items
- Community Moderator
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Exclusive Author
- Grew a moustache for the Envato Movember competition
- Has been a member for 4-5 years
mpc said
Reaper-Media saidThis is strange but I am trying with the PHPMailer with no luck ;/
The reason as to why it doesn’t work is probably because this client’s server has not been configured to use mail() correctly, i.e. the smtp details for a webserver email address have not been setup on the server by the host. Try, as laith said, to use PHPMailer, which will allow you to send emails using any smtp credentials![]()
are you getting any error messages and have you tried sending via smtp? 
- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Community Moderator
- Author was Featured
- Bought between 10 and 49 items
- Referred between 200 and 499 users
- Has been a member for 4-5 years
- Won a Competition
Reaper-Media said
mpc saidare you getting any error messages and have you tried sending via smtp?
Reaper-Media saidThis is strange but I am trying with the PHPMailer with no luck ;/
The reason as to why it doesn’t work is probably because this client’s server has not been configured to use mail() correctly, i.e. the smtp details for a webserver email address have not been setup on the server by the host. Try, as laith said, to use PHPMailer, which will allow you to send emails using any smtp credentials![]()
![]()
no error, yeah I think it was via smtp….
- Author was Featured
- Beta Tester
- Bought between 10 and 49 items
- Community Moderator
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Exclusive Author
- Grew a moustache for the Envato Movember competition
- Has been a member for 4-5 years
mpc said
Reaper-Media saidno error, yeah I think it was via smtp….
mpc saidare you getting any error messages and have you tried sending via smtp?
Reaper-Media saidThis is strange but I am trying with the PHPMailer with no luck ;/
The reason as to why it doesn’t work is probably because this client’s server has not been configured to use mail() correctly, i.e. the smtp details for a webserver email address have not been setup on the server by the host. Try, as laith said, to use PHPMailer, which will allow you to send emails using any smtp credentials![]()
![]()
Care to share the code that you used php mailer with? 
- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Community Moderator
- Author was Featured
- Bought between 10 and 49 items
- Referred between 200 and 499 users
- Has been a member for 4-5 years
- Won a Competition
Reaper-Media said
mpc saidCare to share the code that you used php mailer with?
Reaper-Media saidno error, yeah I think it was via smtp….
mpc saidare you getting any error messages and have you tried sending via smtp?
Reaper-Media saidThis is strange but I am trying with the PHPMailer with no luck ;/
The reason as to why it doesn’t work is probably because this client’s server has not been configured to use mail() correctly, i.e. the smtp details for a webserver email address have not been setup on the server by the host. Try, as laith said, to use PHPMailer, which will allow you to send emails using any smtp credentials![]()
![]()
![]()
Sure, I used something like this with static emails just to check if it works…
<?php include_once('class.phpmailer.php');
$senderName = $_POST['userName'];
$senderEmail = $_POST['userEmail'];
$senderMessage = $_POST['userMsg'];
$emailAddress = $_POST['authorEmail'];
$senderName = stripslashes($senderName);
$senderEmail = stripslashes($senderEmail);
$senderMessage = stripslashes($senderMessage);
$emailAddress = stripslashes($emailAddress);
$mail = new PHPMailer();
$body = $mail?>getFile('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSendmail(); // telling the class to use SendMail transport
$mail->From = "magazinempc@gmail.com";
$mail->FromName = "Magazine MPC";
$mail->Subject = "PHPMailer Test Subject via smtp";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AddAddress("fern666@gmail.com", "Fern");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
- Author was Featured
- Beta Tester
- Bought between 10 and 49 items
- Community Moderator
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Exclusive Author
- Grew a moustache for the Envato Movember competition
- Has been a member for 4-5 years
Yeah you’re not using smtp with that, your just letting PHPMailer setup the php mail() function for you, what you need to do is try to set some SMTP credentials before you call $mail->Send()
$mail->IsSMTP(); // telling the class to use SMTP
// if the smtp server requires authentication (eg. start tls)...
/*
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecurity = "starttls";
$mail->SMTPSecure = "starttls";
*/
$mail->Host = "mail.server.com"; // sets the SMTP server
$mail->Port = 25; // set the SMTP port for the server
$mail->Username = "someone @ server.com"; // SMTP account username
$mail->Password = "password"; // SMTP account password
Good luck 
EDIT :
Also, you can play around with the debugging for PHP Mailer for when it tried to connect to the smtp server:$mail->SMTPDebug = 0; // (0/1/2)
