Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I'm using smtp class to send email from html form using php but it didn't work my client is not receiving any email even in junk mail and when i send the mail from my local host to my email I found it, I used the php mail function alone it didn't work
please help, the php code is:

PHP
include('SMTPconfig.php');
include('SMTPClass.php');
if($_SERVER["REQUEST_METHOD"] == "POST")
{
//$to = "info@topkitchensco.com";
$to = "moh.mannaa@hotmail.com";
$from = $_POST['email'] ;
$subject = "From: contact@topkitchensco.com";
$name = $_POST['name'];
$phone = $_POST['phone'];
$body = "From:$name \n Telephone: $phone \n\n";
$body .= $_POST['message'];
$body = wordwrap($body, 120, "\n", true);
$SMTPMail = new SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body);
$SMTPChat = $SMTPMail->SendMail();
}

?>


and the configuration of the smtp of the website server is correct ( server, port, user and password)
Posted

This is a good tutorial about sending mails in PHP:
http://w3schools.com/php/php_mail.asp[^]
And in the Mail Reference Page of the tutorial, you learn how to configure your email settings:
http://w3schools.com/php/php_ref_mail.asp[^]
 
Share this answer
 
Hi
Use the sendmail binary.

Read this forum. Near the bottom will be an entry by crmpicco on 10-05-2007, 08:39 PM
He explains how to send mail perfectly.

http://www.codingforums.com/archive/index.php/t-124797.html[^]

Jacques
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900