dpacmittal Posted March 9, 2010 Share Posted March 9, 2010 I used an open-source library to send emails to my users on my site. It connected to gmail smtp and sent the mail using it. The script used fsockopen to connect to smtp but recently my shared host disabled it. I want to know if it is possible to send email through gmail's smtp using Curl? If yes, how? Thanks Quote Link to comment Share on other sites More sharing options...
trq Posted March 9, 2010 Share Posted March 9, 2010 Why not get yourself a decent host instead of hacking around the obvious limitations of shared / crappy hosting? Quote Link to comment Share on other sites More sharing options...
dpacmittal Posted March 9, 2010 Author Share Posted March 9, 2010 Why not get yourself a decent host instead of hacking around the obvious limitations of shared / crappy hosting? Well, thats always an option but I want to know if its possible using Curl. So far, google has not given good results. I am starting to suspect that curl cannot be used for the purpose. I want to confirm this. Quote Link to comment Share on other sites More sharing options...
trq Posted March 9, 2010 Share Posted March 9, 2010 I should imagine it would be technically possible. Not something I would bother trying to achieve though. Quote Link to comment Share on other sites More sharing options...
dpacmittal Posted March 9, 2010 Author Share Posted March 9, 2010 I should imagine it would be technically possible. Not something I would bother trying to achieve though. Exactly my thought. I'll just resort to sendmail(). Thanks, anyways. PS: Thinking of getting an unmanaged VPS. Quote Link to comment Share on other sites More sharing options...
gizmola Posted March 9, 2010 Share Posted March 9, 2010 FWIW, gmail offers support for IMAP. This is how phones connect, as well as imap compatible clients like thunderbird or outlook. Rather than trying to use curl, which will not work with gmail, because gmail is a giant javascript application, IMAP would be something you could actually accomplish. You would need of course support for secure imap, and given the limitations of the hosting company, who knows what they might support or not. Did you by any change attempt to engage them in regards to your outbound email issues? Did you ask them how you could perform legitimate and legal outbound emailing via your php based code? ISP's are understandably concerned about email blacklists, so there may be a particular set of hoops or configurations you need to jump through. Quote Link to comment Share on other sites More sharing options...
dpacmittal Posted March 9, 2010 Author Share Posted March 9, 2010 FWIW, gmail offers support for IMAP. This is how phones connect, as well as imap compatible clients like thunderbird or outlook. Rather than trying to use curl, which will not work with gmail, because gmail is a giant javascript application, IMAP would be something you could actually accomplish. You would need of course support for secure imap, and given the limitations of the hosting company, who knows what they might support or not. Did you by any change attempt to engage them in regards to your outbound email issues? Did you ask them how you could perform legitimate and legal outbound emailing via your php based code? ISP's are understandably concerned about email blacklists, so there may be a particular set of hoops or configurations you need to jump through. ofcourse, I was not talking about curl connecting to port 80 and following human steps. I was talking about curl connecting to smtp port and sending the mail using smtp rules. Quote Link to comment Share on other sites More sharing options...
gizmola Posted March 9, 2010 Share Posted March 9, 2010 Most people use curl to scrape web information, since it was primarily designed for http. Previously the answer would have been, absolutely not with curl. The latest version of curl now supports smtp, but that support might not be available in the php api. You certainly don't need curl to do smtp with php, as there are various packages out there beginning with the ones in PEAR that let you do mail queueing and smtp. For example, phpclasses purports to have a couple of classes that will allow for this. 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 Share on other sites More sharing options...
dpacmittal Posted March 9, 2010 Author Share Posted March 9, 2010 Thanks for the link. I'll take a look into it. 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.