Boat Drinks  

Go Back   Boat Drinks > General > Computer and Consoles

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 10-02-2010, 20:53   #1
Aboobie
Vodka Martini
 
Join Date: Sep 2008
Location: Beverley
Posts: 749
Default PHP Mail help!

Ok I need some help!!

I've been doing a web site for a local charity and they want a form that when submitted sends an email.
I've quite happily added a form to the html with client side javascript validation but I'm having trouble with the mail part.

I've decided to use a PHP script to do the work but I'm having trouble getting it all working on their web server. It should be noted I've never worked with PHP before.

Here's what I've written:

<?php

include('Mail.php');
$mail = Mail::factory("mail");


$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$number = $_REQUEST['number'] ;
$course = $_REQUEST['course'] ;
$info = $_REQUEST['info'] ;

$from = "Mr Testie <smcshaw@hotmail.com>";
$to = "Steven Shaw <smcshaw@hotmail.com>";
$subject = "Workshop Enquiry from " + $name;

$body = "Workshop enquiry from: " + $name + "\nEmail: " + $email + "\nTelephone number: " + $number + "\nFor course: " + $course + ".\nAdditional Info: " + $info;

$host = "authsmtp.streamline.net";
$username = "info@themusikeracademy.com";
$password = "*******";

$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));

$mail = $smtp->send($to, $headers, $body);

?>

Is this even vaguely right?


They're with streamline and I've got the added problem of inadvertantly taking their web site down as I changed the web server to linux tonight thinking this might have been my problem.

My questions are where do I need to put this on the web server, what do I need change on the server to get it all working? Basically, HELP!
__________________
Aboobie is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 20:01.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.