BetaONE will rise again!

BetaONE will rise again! (http:\\b1.hcanet.com\forum/index.php)
-   Web Development (http:\\b1.hcanet.com\forum/forumdisplay.php?f=50)
-   -   sendmail using php (http:\\b1.hcanet.com\forum/showthread.php?t=8568)

adams 28th Jun 03 07:21 AM

Code:

Warning: Failed to connect to mailserver, verify your "SMTP" setting in php.ini in \send_simpleform.php on line 19
ok here is the code in in send_simpleform.php
Code:

<?

//if (($_POST[sender_name] == "") && ($_POST[sender_email] == "") && //($_POST[message] == "")) {
//        header("Location: http://xx.xxx.xxx.xxx/simple_form.html");
//        exit;
//}


$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "Sender's Name: &nbsp; &nbsp;$_POST[sender_name]\n";
$msg .= "Sender's E-Mail: &nbsp;$_POST[sender_email]\n";
$msg .= "Message: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$_POST[message]\n\n";

$to = "me@myemail.com";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: $_POST[sender_email]\n\n";

mail($to, $subject, $msg, $mailheaders);

?>

<HTML>
<HEAD>
<TITLE>Simple Feedback Form Sent</TITLE>
</HEAD>
<BODY>

<H1>The following e-mail has been sent:</H1>

<P><strong>Your Name:</strong><br>
<? echo "$_POST[sender_name]"; ?>

<P><strong>Your E-Mail Address:</strong><br>
<? echo "$_POST[sender_email]"; ?>

<P><strong>Message:</strong><br>
<? echo "$_POST[message]"; ?>


</BODY>
</HTML>

ip address and email has been edited out for security. but how come its saying there is an error in that line? do i need to change something in my php.ini file so that i can send email using php?

thanks again everyone.

FOX 28th Jun 03 10:43 AM

Yes you need to edit your php.ini

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com


All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.