Jump to content

Send an auto HTML email to form user


o_oe

Recommended Posts


Hello friend,The form handler below sends form content to my inbox after the user fills it out.Please how can I make it also send the user a HTML newsletter simultenousely.Thanks for you help.<?phpif($_REQUEST[quest1]&& $_REQUEST


== 'second1'){ //print_r($_REQUEST); include("2.htm");exit(); }elseif($_REQUEST[quest2] && $_REQUEST


=='second'){ //print_r($_REQUEST); include("3.htm");exit();}elseif($_REQUEST[quest3] && $_REQUEST


=='third'){ //print_r($_REQUEST); include("4.htm");exit();//////////Question 3#///////////}elseif($_REQUEST[action]=='email'){ $msg = 'Hello '.$_REQUEST[salute].' '.$_REQUEST[fname].' '.$_REQUEST[lname]; $msg.= '<br><br>'; $msg.= 'thanks:-<br>'; $msg.= 'For visiting our site :- '.$_REQUEST[quest1].'<br>'; $msg.= 'message countinue :-'.$_REQUEST[quest2].'<br>'; $msg.= 'continue :-'.$_REQUEST[quest3].'<br>'; $msg.= '<br><br>'; $msg.= 'continue:-<br>'; $msg.= 'Full Name :'.$_REQUEST[salute].' '.$_REQUEST[fname].' '.$_REQUEST[lname].'<br>'; $msg.= 'Address :'.$_REQUEST[address1].'<br>'; $msg.= 'Suite/Apt.# :'.$_REQUEST[address2].'<br>'; $msg.= 'City :'.$_REQUEST[city].'<br>'; $msg.= 'State :'.$_REQUEST[state].'<br>'; $msg.= 'Zip :'.$_REQUEST[zip].'<br>'; $msg.= 'E-mail :'.$_REQUEST.'<br>'; $msg.= 'Phone :'.$_REQUEST[phone].'<br>'; $to = 'myemail@mysite.com'; $subject = 'Enquiry From mysite.com'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers.= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; if(mail($to, $subject, $msg, $headers)){ ?> <script language="javascript">window.location.href='form12.htm'</script> <? }else{ ?> <script language="javascript">window.location.href='form13.htm'</script> <?

Link to comment
Share on other sites

I used this but got an error "Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\www\form.php on line 39"if($send = mail($to, $subject, $msg, $headers)$send2 = mail($to2, $subject2, $autoreply, $headers2))

Link to comment
Share on other sites

I used this but got an error "Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\www\form.php on line 39"if($send = mail($to, $subject, $msg, $headers)$send2 = mail($to2, $subject2, $autoreply, $headers2))
Add parenthesis around your conditions:
if($send = mail($to, $subject, $msg, $headers)) {$send2 = mail($to2, $subject2, $autoreply, $headers2);}
Link to comment
Share on other sites

Add parenthesis around your conditions:
Hi,It didn't work with that.Do you have a PHP script that sends confirmation email to user and shows an instruction page (Check your email). In addition to that sends the website administartor an email.Thanks for your time.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...