Boat Drinks  

Go Back   Boat Drinks > General > Computer and Consoles

Reply
 
Thread Tools Display Modes
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
Old 10-02-2010, 20:57   #2
leowyatt
Chef extraordinaire
 
leowyatt's Avatar
 
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
Default

we send mail through exim on our servers not sure what you are using
__________________
"Dr Sheldon Cooper FTW!"
leowyatt is offline   Reply With Quote
Old 10-02-2010, 21:08   #3
Aboobie
Vodka Martini
 
Join Date: Sep 2008
Location: Beverley
Posts: 749
Default

There's no mention of exim only scripting in PHP, ASP...
__________________
Aboobie is offline   Reply With Quote
Old 10-02-2010, 21:12   #4
leowyatt
Chef extraordinaire
 
leowyatt's Avatar
 
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
Default

what do they use on the server to send email?
__________________
"Dr Sheldon Cooper FTW!"
leowyatt is offline   Reply With Quote
Old 10-02-2010, 21:15   #5
Aboobie
Vodka Martini
 
Join Date: Sep 2008
Location: Beverley
Posts: 749
Default

Quote:
Originally Posted by leowyatt View Post
what do they use on the server to send email?
I've just got the smtp server details. Everything has to be done with a custom script.
__________________
Aboobie is offline   Reply With Quote
Old 10-02-2010, 21:22   #6
leowyatt
Chef extraordinaire
 
leowyatt's Avatar
 
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
Default

try this

http://articles.techrepublic.com.com...1-1045471.html
__________________
"Dr Sheldon Cooper FTW!"
leowyatt is offline   Reply With Quote
Old 11-02-2010, 12:19   #7
Aboobie
Vodka Martini
 
Join Date: Sep 2008
Location: Beverley
Posts: 749
Default

All sorted.

I found out they use JMail so I rewrote it all as an asp. Easy and it all works nice.
__________________
Aboobie is offline   Reply With Quote
Reply


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 06:08.


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