make a PHP Contact Form use SMTP

Hi All,
I am in dire need of help!! I am trying to use this contact form http://www.jbbarry.ie/jbb/contact.html (which works perfectly on a testing server) but will not work on the company domain. It uses a PHP mailer, which apparently my web host has disabled due to spam? So I need to make my PHP mailer work with SMTP.

Below is the form code:

[code]


Request a Company Brochure. [/code]

And below is the PHP script mailer.php, can anyone help me out and explain how to change it into smtp authentication?

[php]<?php
if(isset($_POST[‘submit’])) {
$to = "[email protected]";
$subject = “Brochure Request”;
$name_field = $_POST[‘name’];
$email_field = $_POST[‘email’];

$body = “From: $name_field\n E-Mail: $email_field\n Message:\n $message”;

mail($to, $subject, $body);

header(‘Location: brochure-request.html’);
} else{

echo “test!”;
}
?>[/php]

Thanks in advance for any help you can give me…

By ‘PHP mailer’ do you mean this PHPMailer class?
If yes, I do not see reason for your provider to disable it. Probably your provider just closed port 25?
You can download PHPMailer class, and check scripts in the ‘examples’ folder. There is a demo script that sends email via SMTP.

Sponsor our Newsletter | Privacy Policy | Terms of Service