Oooops. Sent to the wrong address. Forwarding to <a href="mailto:lancaster@mailman.lug.ork.uk">lancaster@mailman.lug.ork.uk</a><br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">
jonath</b> <<a href="mailto:j@jonath.co.uk">j@jonath.co.uk</a>><br>Date: 28-Jun-2007 15:37<br>Subject: Re: [Lancaster] Help needed with email from web pages<br>To: Ken Hough <<a href="mailto:kenhough@uklinux.net">
kenhough@uklinux.net</a>><br><br></span>Ken,<br><br>Like Matt, I've always used the built-in mail function of php:<br><br><a href="http://uk.php.net/manual/en/function.mail.php" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://uk.php.net/manual/en/function.mail.php</a><br><br>The problem may be that you're not putting in the headers, but I appreciate these aren't absolutely necessary. A typical header might be: <br><br>        $headers = "From: Webmaster <
webmaster@somewhere.co.uk\n";<br>        $headers .= "X-Sender: <<a href="mailto:webmaster@somewhere.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">webmaster@somewhere.co.uk</a>>\n";
<br>        $headers .= "X-Mailer: SMCPHP4.05(SG2001)\n";<br>        $headers .= "Return-Path: <<a href="mailto:postmaster@somewhere.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">postmaster@somewhere.co.uk
</a>>\n\r";<br><br>[replace <a href="http://somewhere.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">somewhere.co.uk </a> as appropriate]<br><br>Also, bear in mind the following:<br>
<br>'Note: When sending mail, the mail must contain a From header. This can be set with the additional_headers parameter, or a default can be set in php.ini . <br><br>Failing to do this will result in an error message similar to Warning: mail(): "sendmail_from" not set in
php.ini or custom "From:" header missing. The From header sets also Return-Path under Windows.' [from the PHP web-site] <br><br>So, given you were not using a header, PHP might have been checking php.ini for a valid 'from' address and maybe one did not exist there.
<br><br>Regards,<br><br>Jonathan<div><span class="e" id="q_11372c3f26339d76_1"><br><br><br><div><span class="gmail_quote"> On 28/06/07, <b class="gmail_sendername">Ken Hough</b> <<a href="mailto:kenhough@uklinux.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
kenhough@uklinux.net</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
Hi Guys!<br><br>Can you help me? I'm building a website and need to provide for sending<br>email messages from within the site.<br><br>I been using PHP and for test/dev purposes run my own local webserver<br>(apache with mod_php). I know that the web server and the PHP bit work
<br>OK, because the website uses PHP successfully for a number of other tasks.<br><br>Using the very simple code:<br><br><?php<br>// The message<br>$message = "Line 1\nLine 2\nLine 3";<br><br>// In case any of our lines are larger than 70 characters, we should use
<br>wordwrap()<br>$message = wordwrap($message, 70);<br><br>// Send<br>$x = mail('<a href="mailto:kenhough@uklinux.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">kenhough@uklinux.net</a>', 'My Subject', $message);
<br><br>echo $message.'<br>'; <br>if($x == TRUE) echo "TRUE".'<br>';<br>if($x == FALSE) echo "FALSE".'<br>';<br>?><br><br>appears to send a message --- at least judging by the LED activity on
<br>my ADSL /router, but no messages appear in my mail box and 'TRUE' is <br>echoed to the screen.<br><br>What am I missing?<br><br>Can annyone recomend a good Internet link on the subject?<br><br><br>Ken Hough<br>
<br>_______________________________________________<br>Lancaster mailing list<br><a href="mailto:Lancaster@mailman.lug.org.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Lancaster@mailman.lug.org.uk
</a><br><a href="https://mailman.lug.org.uk/mailman/listinfo/lancaster" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://mailman.lug.org.uk/mailman/listinfo/lancaster</a><br></blockquote></div>
<br></span></div>