ChaosKnight Posted April 30, 2010 Share Posted April 30, 2010 Okay, so I have a script for a "contact us" form that inserts an entry in the database (which works), but because this a brand new system for the company, they requested that for the first few months they also want to receive a similar e-mail message... I never actually used PHP Mail before, seeing that I like the functionality of the database more... Here is a code snippet of the action for the form that I wrote: <?php if (isset($_POST['name']) && isset($_POST['email'])){ $email_to = $mail_address; $email_msg = $_POST['message']; $email_subj = $_POST['subject']; if(mail($email_to,$email_subj,$email_msg)) { echo("<h3>Message successfully sent...</h3>"); }else{ echo("<h3>Message could not be delivered...</h3>"); } } ?> But when I try to send it, it fails... I contacted the client's shared hosting company, but they said that they didn't have any PHP mailing support but I can write a custom script that includes the SMTP address and password, etc. My question is: How can I set this up and send an email message that works? Any help would be greatly appreciated Quote Link to comment Share on other sites More sharing options...
947740 Posted April 30, 2010 Share Posted April 30, 2010 I just use gmail through smtp - using the phpmailer class that's available free online. Quote Link to comment Share on other sites More sharing options...
ChaosKnight Posted April 30, 2010 Author Share Posted April 30, 2010 Is there a simple tutorial on using PHPMailer? Or a simpler way for sending e-mail? As I said, it's only a very temporary use, I don't want to spend much time on this, seeing that I have to remove it in a couple of months... Quote Link to comment Share on other sites More sharing options...
947740 Posted April 30, 2010 Share Posted April 30, 2010 http://www.google.com/search?hl=en&source=hp&q=phpmailer+google+smtp&aq=f&aqi=&aql=&oq=&gs_rfai=&emsg=NCSR&ei=AS_bS7udDYennQfV25kw&safe=active First result. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.