affordit Posted January 17, 2008 Share Posted January 17, 2008 The first part of the script below works but I can't get the second part to send me an email with the actual question the visitor asked can some help. <?php $to = "$email"; $subject = "Question"; $message="Thank you for your question we will contact you at $email with the answer"; $headers = "From: me@there"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "We have sent you a conformation email to $email"; } else {print "We encountered an error sending your mail"; } $to = "me@there"; $subject = "Question"; $message="message"; $headers = "From: visitors email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } ?> Link to comment https://forums.phpfreaks.com/topic/86401-solved-problem-with-php-mail/ Share on other sites More sharing options...
Kasak Posted January 17, 2008 Share Posted January 17, 2008 Do you have a form where the user is filling the data? Can you provide with your code? Link to comment https://forums.phpfreaks.com/topic/86401-solved-problem-with-php-mail/#findComment-441508 Share on other sites More sharing options...
affordit Posted January 17, 2008 Author Share Posted January 17, 2008 Thanks for the help all I solved the prob. I had a conflict with the message variables had to change the second one to get it to work. Link to comment https://forums.phpfreaks.com/topic/86401-solved-problem-with-php-mail/#findComment-441531 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.