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 Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/ 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? Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/#findComment-1023444 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. Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/#findComment-1023454 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. Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/#findComment-1023456 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. Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/#findComment-1023458 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. Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/#findComment-1023462 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. Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/#findComment-1023467 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 Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/#findComment-1023482 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. Link to comment https://forums.phpfreaks.com/topic/194594-using-curl-to-send-email-through-smtp/#findComment-1023496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.