thmar Posted December 9, 2007 Share Posted December 9, 2007 I'm having a rather same scenerio here for weeks without getting a feasible solution, can any1 help me with this?? As i'm totally new to PHP, i tried many methods found online but got stuck at some stage e.g changing php.ini, using swiftmailer etc. So can any1 guide me along, assuming i jux installed my php and did nth to it...really apreciate it You see, i'm currently working on a web application which involve sending emails to user. I'm using windowXP SP2, with apache installed incorporate with MySQL as my server. Rite now my code for sending the mail is : <?php require_once "Mail.php"; $from = "Sandra Sender <sender@example.com>"; $to = "Ramona Recipient <recipient@example.com>"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "smtp.yahoo.com"; $username = "smtp_username"; $password = "smtp_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); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } ?> As you can see, i'm trying to use yahoo as my external smtp mail server to help send my mail to my application end user. Any guidance plss??? tnx alot Quote Link to comment Share on other sites More sharing options...
VirusDoctor Posted December 9, 2007 Share Posted December 9, 2007 Hi thmar, firstly, I doubt yahoo will like that too much, using their smtp surely cant be legal to do? Secondly, I'd advise you to go to google, do a search for Apache2Triad, download and install it. Its one installer that install Apache, mysql, php and phpmyadmin all in one with no errors at all, best is that its all setup and ready to use right after the install is complete. I would then advise you to grab a copy of PHPMailer, go through their tutorial on the site and use that for your script, you wont be sorry. Hope any of that helps Shaun Quote Link to comment Share on other sites More sharing options...
thmar Posted December 18, 2007 Author Share Posted December 18, 2007 thanks for ur advice shaun I definitely going to try it out Cheers Quote Link to comment Share on other sites More sharing options...
hamza Posted December 19, 2007 Share Posted December 19, 2007 i want to send email using php5. but dont no how to send so please how to send email i know the mail funcion. but dont no the minimum parameters and the what kind of changes i have to made to send email in php.ini file. AND how many headers are required and what is php mailer thanks if someone help me Quote Link to comment Share on other sites More sharing options...
mattyb_53 Posted December 20, 2007 Share Posted December 20, 2007 Im struggling to send emails myself. Problem is, that the SMTP server isnt relaying emails. They are just discarded. Hamza, google php mail function. That will bring up the mail function and some examples. php mailer I believe is a helper library to help with sending mail, adding attachments etc. Quote Link to comment Share on other sites More sharing options...
rameshfaj Posted December 20, 2007 Share Posted December 20, 2007 Different mail servers like yahoo or hotmail use/require different types of headers.try to select the appropriate header Quote Link to comment Share on other sites More sharing options...
jeppers Posted December 20, 2007 Share Posted December 20, 2007 why don't you try using ur own server. i use a sevice called bravehost its good. £5 per month and just buy ur self a web address. u see i was doing the same thing when i started to play with email. and i found it worth while in the end. hope u will consider it Quote Link to comment Share on other sites More sharing options...
hamza Posted December 23, 2007 Share Posted December 23, 2007 Please explain me about the mail() function and requirements for sending email to anyone using mail function thanks if someone help me Quote Link to comment Share on other sites More sharing options...
juapo2 Posted December 24, 2007 Share Posted December 24, 2007 If you cant send, maybe it is because your server has bllocked the Email sending with php and smtp sending, you should also know, that yahoo uses SSLlogin, and uses a port to send emails, eg. 25 or 587 Contact your webserver about the mail funcionts 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.