abdfahim Posted October 1, 2010 Share Posted October 1, 2010 Hi, Can someone please post very straight forward lines for sending email (no attachment nothing, just a subject and one line text in body) using google smtp (ssl://smtp.gmail.com) without any help of some classes like PHPmailer? Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/214901-mail-using-google-smtp/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 1, 2010 Share Posted October 1, 2010 You would need to write the code to open a socket connection to the mail server and exchange smtp commends with it, including those necessary to use SMTP Authentication, the same as what one of those classes are doing in their code. So, instead of writing and testing a couple of dozen lines of code, why don't you just use one of the existing classes? Quote Link to comment https://forums.phpfreaks.com/topic/214901-mail-using-google-smtp/#findComment-1117937 Share on other sites More sharing options...
abdfahim Posted October 1, 2010 Author Share Posted October 1, 2010 The reason is that all those classes consist of many options (like attachment etc.) that requires several files and many lines of coding. And so, most of those classes consists redundant (or unnecessary) lines for my cause (as I said, I need only one line body with a subject). Quote Link to comment https://forums.phpfreaks.com/topic/214901-mail-using-google-smtp/#findComment-1117996 Share on other sites More sharing options...
PFMaBiSmAd Posted October 1, 2010 Share Posted October 1, 2010 The only way you can send to or through a mail server that has not been configured to trust the IP address of the server where your script is running at is to use SMTP Authentication. Since the php mail() function does not support SMTP Authentication, you must either use one of the classes that does or write your own code to communicate directly with the mail server and exchange the necessary smtp commands with it. Quote Link to comment https://forums.phpfreaks.com/topic/214901-mail-using-google-smtp/#findComment-1118002 Share on other sites More sharing options...
abdfahim Posted October 1, 2010 Author Share Posted October 1, 2010 Yup, I know i can't use mail() .. that's why i was just thinking whether I can have some code/tutorial to write minimum number of lines that'll serve my purpose. Anyway, I think I better use built in classes for that. Thanks anyway. Quote Link to comment https://forums.phpfreaks.com/topic/214901-mail-using-google-smtp/#findComment-1118013 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.