Click here to Skip to main content
15,900,676 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:

//$to = "";
$to = "";
$from = $_POST['email'] ;
$subject = "From:";
$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)

This is a good tutorial about sending mails in PHP:[^]
And in the Mail Reference Page of the tutorial, you learn how to configure your email settings:[^]
Share this answer
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.[^]

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