Porkie Posted May 19, 2009 Share Posted May 19, 2009 Basically i want this form to be used to refer friends to my website.Everything seems to work except no email is actually sent to the accounts of the members typed into the form. Why is this? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form id="referral" name="referral" method="post" action="Thanks.php"> <p>Your Name : <input name="yn" type="text" id="yn" size="35" maxlength="35" /> </p> <label></label> <p>Email Address1 : <label> <input name="ea1" type="text" id="ea1" size="35" maxlength="35" /> </label> </p> <p>Email Address 2 : <input name="ea2" type="text" id="ea2" size="35" maxlength="35" /> </p> <p>Email Address3 : <input name="ea3" type="text" id="ea3" size="35" maxlength="35" /> </p> <p>Email Address 4 : <input name="ea4" type="text" id="ea4" size="35" maxlength="35" /> </p> <p>Email Address 5 : <input name="ea4" type="text" id="ea4" size="35" maxlength="35" /> </p> <p>Email Address 6 : <input name="ea6" type="text" id="ea6" size="35" maxlength="35" /> </p> <p>Email Address 7 : <input name="ea7" type="text" id="ea7" size="35" maxlength="35" /> </p> <p>Email Address 8 : <input name="ea8" type="text" id="ea8" size="35" maxlength="35" /> </p> <p> <label> <input type="Submit" name="Submit" value="Submit" /> </label> </p> </form> </body> </html> <style type="text/css"> <!-- body,td,th { color: #FFFFFF; } body { background-color: #000000; } h2 { color #ffffff; font-family: arial; text-align: center; font:Arial; font-size:14px } --> </style><title></title> <div align="center"><img src="images/gr-edit.png" width="604" height="100"></div> <?php if(isset($_POST['Submit'])) { $user = $_POST['yn']; $email1 = $_POST['ea1']; $email2 = $_POST['ea2']; $email3 = $_POST['ea3']; $email4 = $_POST['ea4']; $email5 = $_POST['ea5']; $email6 = $_POST['ea6']; $email7 = $_POST['ea7']; $email8 = $_POST['ea8']; $to = " $email1 $email2 $email3 $email4 $email5 $email6 $email7 $email8 "; $subject = ""; $body = " /n You have been invited to our network by $user "; echo "<h2>Thankyou For Inviting Your Friends To Our Network $user </h2>" ; echo "<h2>An Email Has Been Sent To, /n $email1, /n $email2, /n $email3, /n $email4, /n $email5, /n $email6, /n $email7, /n $email8 </h2>" ; echo "<a href=''><h2>Home</h2></a>"; mail($to, $subject, $body); } ?> Also how can i get this to actually go underneath each other? do i need to use "/n" or something else? echo "<h2>An Email Has Been Sent To, /n $email1, /n $email2, /n $email3, /n $email4, /n $email5, /n $email6, /n $email7, /n $email8 </h2>" ; Cheers In advance Link to comment https://forums.phpfreaks.com/topic/158797-refer-a-friend-form/ Share on other sites More sharing options...
Ken2k7 Posted May 19, 2009 Share Posted May 19, 2009 Well since it's HTML, use <br /> Link to comment https://forums.phpfreaks.com/topic/158797-refer-a-friend-form/#findComment-837526 Share on other sites More sharing options...
Porkie Posted May 19, 2009 Author Share Posted May 19, 2009 any help on why the emails arent being sent ? Link to comment https://forums.phpfreaks.com/topic/158797-refer-a-friend-form/#findComment-837583 Share on other sites More sharing options...
Ken2k7 Posted May 19, 2009 Share Posted May 19, 2009 The $to address is wrong? You separate recipients by commas, like you do with other mail clients like GMail, Yahoo, Hotmail etc. Link to comment https://forums.phpfreaks.com/topic/158797-refer-a-friend-form/#findComment-837585 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.