Jump to content

Archived

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

nphls

Help with an email form plz

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 = 'teste@test.com';
$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]

Share this post


Link to post
Share on other sites
To the best of my knowledge you don't have to set up anything. The mail() function should just work in a php environment.

Share this post


Link to post
Share on other sites

×

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.