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 = '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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.