emopoops Posted December 14, 2009 Share Posted December 14, 2009 cause i heard u can do that but i dont know how Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/ Share on other sites More sharing options...
trq Posted December 14, 2009 Share Posted December 14, 2009 If you have sufficient permissions on your server you can setup ssmtp as your sendmail alias. Otherwise, you might be able to do this using a third party mail class such as Zend_Mail. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976732 Share on other sites More sharing options...
emopoops Posted December 14, 2009 Author Share Posted December 14, 2009 cant i use gmail? Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976757 Share on other sites More sharing options...
trq Posted December 14, 2009 Share Posted December 14, 2009 Not directly no. PHP generally sends emails via the systems sendmail program. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976759 Share on other sites More sharing options...
emopoops Posted December 14, 2009 Author Share Posted December 14, 2009 ok well i contacted my host about it not working or sending 30 -60 minutes after the code is run and they stated its because of some filtering it goes through and gave me a link to http://phpmailer.worxware.com/index.php?pg=projects it says its some license thing i dont understand licenses i try to stay away from them. does nayone know if its free for liek comercial sites or whatever to use? cause i am going to have a webstore on my site etc in the future and i cant use anything that doesnt allow comercial use for free. and also... on the forum i read something about the users using google apps for mail but ive done some googling and stuff i cant figure out how to send mail with that it makes no sense does anyone know what that is?? http://www.google.com/apps/intl/en/group/index.html Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976763 Share on other sites More sharing options...
trq Posted December 14, 2009 Share Posted December 14, 2009 PHPMailer is licensed under the LGPL which means it is basically free to use. What is it exactly you want to know about using google apps for mail? if your users want to setup google apps for mail, you will still need a third party class such as PHPMailer (or my before mentioned zend_Mail) to connect to google and send from your sites. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976775 Share on other sites More sharing options...
Deoctor Posted December 14, 2009 Share Posted December 14, 2009 Hai try this to send emails using the gmail as an smtp.. <?php require_once "Mail.php"; $from = "Chaitu <drvirusindia@gmail.com>"; $to = "Chaitu <drvirusindia@gmail.com>"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "ssl://mail.example.com"; $port = "465"; $username = "smtp_username"; $password = "smtp_password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, '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>"); } ?> but you require a correct user id and password to use it. u can use the gmail user id and pass ... Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976781 Share on other sites More sharing options...
trq Posted December 14, 2009 Share Posted December 14, 2009 try this to send emails using the gmail as an smtp.. Providing PEAR's Mail class is installed. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976782 Share on other sites More sharing options...
emopoops Posted December 14, 2009 Author Share Posted December 14, 2009 what pears mail class? sorry how do i figure out if thats installed? is that script similar to this one i found: http://blog.dagoosh.com/post/2009/03/17/google-apps-gmail-send-email-asp.aspx well the admin on the support forum says that free hosting account users like me uuse google apps to send but i cant figure out how.. so i guess the host lets the free accounts use it but how? oh and basically free? whats that actually mean? if i have a webstore that sends mails all the time for comerical uses can i still use it or what? i dont get licenses Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976880 Share on other sites More sharing options...
Deoctor Posted December 14, 2009 Share Posted December 14, 2009 just check ur phpinfo() in it u can find out.. include_path.;C:\xampp\php\PEAR.;C:\xampp\php\PEAR Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976911 Share on other sites More sharing options...
emopoops Posted December 14, 2009 Author Share Posted December 14, 2009 i did phpinfo() then i did a find for the word pear and none was found Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976917 Share on other sites More sharing options...
Deoctor Posted December 14, 2009 Share Posted December 14, 2009 which version of xampp ur using up?? Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976923 Share on other sites More sharing options...
Deoctor Posted December 14, 2009 Share Posted December 14, 2009 just check these artilces which can help u out http://www.cyberciti.biz/tips/rhel-install-php-net-smtp-email-socket.html http://pear.php.net/manual/en/guide.users.commandline.installing.php also when u open php.ini it should have this line uncommented. include_path = ".;C:\xampp\php\PEAR" Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976939 Share on other sites More sharing options...
emopoops Posted December 14, 2009 Author Share Posted December 14, 2009 i dont know what xampp is and i have free host theres no php ini Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976947 Share on other sites More sharing options...
Deoctor Posted December 14, 2009 Share Posted December 14, 2009 then ur server might not be supportive to the pear(smtp autentication).so i dont think u can use it out.. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976949 Share on other sites More sharing options...
trq Posted December 14, 2009 Share Posted December 14, 2009 This isn't going anywhere fast. At minimum you need to install one of these third party classes to be able to use gmail's smtp server easily. You can use either (and this is by no means a definitive list) PHPMailer, PEAR's Mail or Zend_Mail. I suggest you decide which one you want to use, read the installation instructions and get one installed. If you get stuck, let use know exactly where you are stuck. From there, you will need to (again) read the manual for the specific class to find out how to use it. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976952 Share on other sites More sharing options...
Deoctor Posted December 14, 2009 Share Posted December 14, 2009 hai thorpe. he is using an free hosting service so i dont think he could able to do that.. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976957 Share on other sites More sharing options...
trq Posted December 14, 2009 Share Posted December 14, 2009 hai thorpe. he is using an free hosting service so i dont think he could able to do that.. Why? These scripts are all written in php. You just place then on your server, put them within your include path then include and use them. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976958 Share on other sites More sharing options...
ignace Posted December 14, 2009 Share Posted December 14, 2009 Try this class written by Manuel Lemos: http://www.phpclasses.org/blog/package/9/post/1-Sending-email-using-SMTP-servers-of-Gmail-Hotmail-or-Yahoo-with-PHP.html Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976972 Share on other sites More sharing options...
ignace Posted December 14, 2009 Share Posted December 14, 2009 $transportConfig = array('smtp_host' => 'smtp.gmail.com', 'smtp_port' => '456', 'smtp_ssl' => '1', 'smtp_user' => 'mail@gmail.com', 'smtp_password' => 'mail password'); $transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $transportConfig); $mail = new Zend_Mail(); $mail->setFrom('user@mail.com'); $mail->setReplyTo('user@mail.com'); $mail->setReturnPath('user@mail.com');// in case of failed delivery $mail->setSubject('Mail Subject'); $mail->addTo('mail@gmail.com'); $mail->setBodyText('Mail Message');// or $mail->setBodyHtml('Html Mail Message'); $mail->send($transport); Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-976990 Share on other sites More sharing options...
emopoops Posted December 14, 2009 Author Share Posted December 14, 2009 well does anyone know a script to google apps? cause i read something by the admin that the users do that because the hosts email is slow Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-977005 Share on other sites More sharing options...
trq Posted December 14, 2009 Share Posted December 14, 2009 well does anyone know a script to google apps? A script to do what with google apps? Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-977008 Share on other sites More sharing options...
rajeevbharti Posted December 14, 2009 Share Posted December 14, 2009 cause i heard u can do that but i dont know how [/quot hi friend i have same kind of problem any body could help us to solve the problem. Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-977011 Share on other sites More sharing options...
emopoops Posted December 15, 2009 Author Share Posted December 15, 2009 ok this zend mail thing that someone left a code for... is this free for use on commercial websites? because my site is going to have a webstore etc.. and i wanted a code to use google apps to send mail from my site. because i cant use my hosts email sender it sucks. like on a registration it sends an email that the user has to click on the link in the email to verify its an ok email Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-977521 Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 Yes it is free. Yes, with it you can send mail via google smtp servers (including those used by google app domains). Quote Link to comment https://forums.phpfreaks.com/topic/185036-does-anyone-know-a-php-script-to-send-mail-using-gmailsgoogles-free-smtp-server/#findComment-977537 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.