mailer form
Posted: Thu Apr 16, 2009 9:38 am
im designing a website for uni and we are using server2go so that we can view the php script. i have a form that lets a user select an email address from a drop down, but when i send the message i get this error message,
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Users\Steffi\Desktop\dissertation second site\server\distribute_apache2.0\htdocs\sendmail.php on line 15
my php code for this is
looking at the config files i found this
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
how would i set this within the form?
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Users\Steffi\Desktop\dissertation second site\server\distribute_apache2.0\htdocs\sendmail.php on line 15
my php code for this is
Code: Select all
<?php
if (isset($_POST['send']))
{
$to = $_POST['emailler'];
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$subject = "Website Question";
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
echo "Data has been submitted to $to!";
mail ($to, $body, $subject);
} else {
echo "your email has not been sent please try again!";
}
?>[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
how would i set this within the form?