merck_delmoro Posted November 12, 2009 Share Posted November 12, 2009 I am building a php code that sends an email but when I use mail function it is not working properly I try a simple code of mail it is not working either and also i try the codes form w3schools the tutorial of scripts I copy paste the code and try it but still not working is there any alternative ways to mail using php??? Quote Link to comment Share on other sites More sharing options...
darkvengance Posted November 12, 2009 Share Posted November 12, 2009 Look up some stuff on SMTP, heres a nice little tutorial to help you out: http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm Quote Link to comment Share on other sites More sharing options...
justAnoob Posted November 12, 2009 Share Posted November 12, 2009 This is what i use. Hope it helps. <?php $to = 'whoever'; $subject = 'whatever'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: you@you.com' ; $message = 'blah blah blah'; mail($to, $subject, $message, $headers); ?> Quote Link to comment Share on other sites More sharing options...
justAnoob Posted November 12, 2009 Share Posted November 12, 2009 Set your page up so there is a form to fill out, so you can enter in the email to whom you wish to send it to. Then have a submit button, so when clicked, the mail function is called and it grabs your vars from the form. Quote Link to comment Share on other sites More sharing options...
darkvengance Posted November 12, 2009 Share Posted November 12, 2009 Your host may not have the mail function enabled, many hosts (especially free ones) turn that function off to avoid having spam sent from their servers. 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.