|
10-02-2010, 20:53 | #1 |
Vodka Martini
Join Date: Sep 2008
Location: Beverley
Posts: 749
|
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! |
10-02-2010, 20:57 | #2 |
Chef extraordinaire
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
|
we send mail through exim on our servers not sure what you are using
__________________
"Dr Sheldon Cooper FTW!" |
10-02-2010, 21:08 | #3 |
Vodka Martini
Join Date: Sep 2008
Location: Beverley
Posts: 749
|
There's no mention of exim only scripting in PHP, ASP...
|
10-02-2010, 21:12 | #4 |
Chef extraordinaire
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
|
what do they use on the server to send email?
__________________
"Dr Sheldon Cooper FTW!" |
10-02-2010, 21:15 | #5 |
Vodka Martini
Join Date: Sep 2008
Location: Beverley
Posts: 749
|
I've just got the smtp server details. Everything has to be done with a custom script.
|
10-02-2010, 21:22 | #6 |
Chef extraordinaire
Join Date: Jul 2006
Location: Infinite Loop
Posts: 11,143
|
__________________
"Dr Sheldon Cooper FTW!" |
11-02-2010, 12:19 | #7 |
Vodka Martini
Join Date: Sep 2008
Location: Beverley
Posts: 749
|
All sorted.
I found out they use JMail so I rewrote it all as an asp. Easy and it all works nice. |
Thread Tools | |
Display Modes | |
|
|