Jump to content


Photo

Help with an email form plz


  • Please log in to reply
2 replies to this topic

#1 nphls

nphls
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 09 June 2006 - 11:33 PM

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:

<?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");
}
?>


#2 nphls

nphls
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 10 June 2006 - 12:00 PM

Can anyone give me a hand?
I'd really pareciate your help

#3 yonta

yonta
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 10 June 2006 - 12:24 PM

To the best of my knowledge you don't have to set up anything. The mail() function should just work in a php environment.
do it, do it right, do it right now




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users