Alexhoward Posted March 26, 2008 Share Posted March 26, 2008 Hi, I'm using Streamline.net as my server. 1st of all... is anyone else? I've got a test mail script, but i'm not receiving anything... Just wondering if anyone else has encountered this problem, and managed to solve it here's the code: <?php $to = "[email protected]"; $sub = "testing"; $mess = "is it working"; mail($to, $sub, $mess, "From: [email protected]", "-froot\@everyonlinestore.co.uk"); ?> Thanks in advance!! Link to comment https://forums.phpfreaks.com/topic/97946-php-mail-script-with-streamlinenet-not-working/ Share on other sites More sharing options...
Alexhoward Posted March 26, 2008 Author Share Posted March 26, 2008 oh, just incase anyone is wondering. the knowledge base on for my host says i need the 5 parameters. not sure what the -f and \@ is for but that's what they say, however... nothing is coming through, and i'm not getting any errors... Link to comment https://forums.phpfreaks.com/topic/97946-php-mail-script-with-streamlinenet-not-working/#findComment-501149 Share on other sites More sharing options...
LemonInflux Posted March 26, 2008 Share Posted March 26, 2008 I'm on streamline, and mail works fine for me. php.net/mail copy one of their scripts and edit it to whatever you need. That's the easiest option. Link to comment https://forums.phpfreaks.com/topic/97946-php-mail-script-with-streamlinenet-not-working/#findComment-501177 Share on other sites More sharing options...
Alexhoward Posted March 26, 2008 Author Share Posted March 26, 2008 Hi, thanks for replying are you on a windows server...? Link to comment https://forums.phpfreaks.com/topic/97946-php-mail-script-with-streamlinenet-not-working/#findComment-501187 Share on other sites More sharing options...
kenrbnsn Posted March 26, 2008 Share Posted March 26, 2008 The string: "-froot\@everyonlinestore.co.uk" can be written as '-f [email protected]' That parameter will make your email message look like it's coming from you, not the server. Ken Link to comment https://forums.phpfreaks.com/topic/97946-php-mail-script-with-streamlinenet-not-working/#findComment-501209 Share on other sites More sharing options...
Alexhoward Posted March 26, 2008 Author Share Posted March 26, 2008 Hi Ken, thanks for replying I contacted my host and they've sorted it out. my code now looks like this mail form: <form method="post" action="sendemail.php"> <!-- DO NOT change ANY of the php sections --> <?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> Your Name: <br /> <input type="text" name="visitor" size="35" /> <br /> Your Email:<br /> <input type="text" name="visitormail" size="35" /> <br /> <br /> <br /> Attention:<br /> <select name="attn" size="1"> <option value=" Sales n Billing ">Sales n Billing </option> <option value=" General Support ">General Support </option> <option value=" Technical Support ">Technical Support </option> <option value=" Webmaster ">Webmaster </option> </select> <br /><br /> Mail Message: <br /> <textarea name="notes" rows="4" cols="40"></textarea> <br /> <input type="submit" value="Send Mail" /> <br /> </form> and the send script: <?php $ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $notes = $_POST['notes']; $attn = $_POST['attn']; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($visitor) || empty($visitormail) || empty($notes )) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $attn = $attn ; $subject = $attn; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Attention: $attn \n Message: $notes \n From: $visitor ($visitormail)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; ini_set("sendmail_from", "[email protected]"); mail("[email protected]", $subject, $message, "From: [email protected]", "[email protected]"); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) <br /> Attention: <?php echo $attn ?> <br /> Message:<br /> <?php $notesout = str_replace("\r", "<br/>", $notes); echo $notesout; ?> <br /> <?php echo $ip ?> <br /><br /> <a href="contact.php"> Next Page </a> </p> where i had to "ini_set("sendmail_from", "[email protected]");" are you saying i should change: "[email protected]" to: "-f [email protected]"...? i'd really like it to think it was coming from the users email address inputted into the form Thanks for your help Link to comment https://forums.phpfreaks.com/topic/97946-php-mail-script-with-streamlinenet-not-working/#findComment-501272 Share on other sites More sharing options...
Alexhoward Posted March 26, 2008 Author Share Posted March 26, 2008 Also: Additional Info : Browser Info: Referral : does not work, but i'm still working on it... Link to comment https://forums.phpfreaks.com/topic/97946-php-mail-script-with-streamlinenet-not-working/#findComment-501289 Share on other sites More sharing options...
Alexhoward Posted March 26, 2008 Author Share Posted March 26, 2008 Sweet! don't worry it's working!! cheers kenrbnsn Link to comment https://forums.phpfreaks.com/topic/97946-php-mail-script-with-streamlinenet-not-working/#findComment-501339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.