Jump to content

Help with an email form plz


nphls

Recommended Posts

Hi.
I'd like to know how can i set the SMTP server when sending mails through mail()function.
Do you know how i can do that? If you do, plz let me no.

I have the following code if it helps:

[code]<?php
$to = '[email protected]';
$from = $_POST['email'];
$subject = $_POST['msg'];
$confirm = 'confirm.php';
$error = 'mailerror.php';

// Don't touch anything else //

$mailheader = "From: $from";
$mailheader .= "Reply-To: $from";
if (isset($HTTP_POST_VARS)){
$mailbody = '';
while (list($key, $value) = each($HTTP_POST_VARS))
{
$mailbody .= $key . ' = ' . $value . "rn";
}
}
$mailforms = mail($to, $subject, $mailbody, $mailheader);
if($mailforms)
{
include("$confirm");
}
else
{
include("$error");
}
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/11623-help-with-an-email-form-plz/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.