haitamlong 0 Report post Posted October 4, 2006 Can anyone here tell me how to send mail through SMTP server with php I have search in many source code on web and cant find anything Share this post Link to post Share on other sites
Houdini 0 Report post Posted October 4, 2006 (edited) What you are probably really wanting to use is the mail() function which is used pretty widely with PHP. I personally use this function on my local PC which is connectted persistently through a DSL connection (256k download and 126 upload tested) my test scripts run as long as they are coded properly and so I test them to my own e-mail address to check for errors or to make improvements to them. If you are simply wanting to use PHP to send e-mail then just click the link above that I provided and if you have any difficulties sending to your own email then you could post again with those problems with any errors encountered or anomolies with your script and I will be glad to help you with it. You could also PM me about the problems real or imagened. Welcome to the world of PHP here on Xisto. Edited October 4, 2006 by Houdini (see edit history) Share this post Link to post Share on other sites
iGuest 3 Report post Posted October 5, 2006 If you're searching for a way to send via SMTP, then I guess you don't mean the mail() function as you would find tonnes of information on that.There's an alternative way, using PHP and sockets to connect to the SMTP server and send the commands that are requested by the SMTP server, the problem however is that most SMTP servers are set up to not allow RELAYing of messages from outside without SMTP authentification that you are actually an allowed user to use that SMTP server, reason being many SPAM mailers could use these servers to distribute their mail if they were not secured against it.If you want to find ideas, look for SMTP via Telnet methods, and then learn PHP sockets to do the exact same thing, as the method is just the same, except you're using PHP to do what you would do in Telnet.You will probably also need to read the RFC on SMTP so you can understand how verification and authentification is done, as well as limitations on it.Cheers,MC Share this post Link to post Share on other sites
Hercco 0 Report post Posted October 8, 2006 Yep, you basically could build an SMTP client with PHP. It's actually quite easy if you understand protocols in general and have some experience in socket programming. What I suggest is that you read RFC821 (for example here: http://www.ietf.org/rfc/rfc0821.txt) and then take a look at PHP manual for sockets. If you want example code, you'll be able to find tons at least in C language. I remember reading about an open source project for a PHP class containing bunch of emailing functionalities including smtp. Unfortunately I wasn't able to find anything on it right now. And I do believe PEAR package has some sort of SMPT implementation. Share this post Link to post Share on other sites
Sherif G.s 0 Report post Posted February 10, 2007 Yep, you basically could build an SMTP client with PHP. It's actually quite easy if you understand protocols in general and have some experience in socket programming. What I suggest is that you read RFC821 (for example here: http://www.ietf.org/rfc/rfc0821.txt) and then take a look at PHP manual for sockets. If you want example code, you'll be able to find tons at least in C language. I remember reading about an open source project for a PHP class containing bunch of emailing functionalities including smtp. Unfortunately I wasn't able to find anything on it right now. And I do believe PEAR package has some sort of SMPT implementation. this site dunt work'n broif ya have anysite be da same plz post itthx Share this post Link to post Share on other sites
WeaponX 0 Report post Posted February 11, 2007 The site does work. It's just that the forum has included the right parenthesis. This is by design. So just take away the right parenthesis... http://www.ietf.org/rfc/rfc0821.txt Share this post Link to post Share on other sites
iGuest 3 Report post Posted September 26, 2007 Get phpMailer .It's a nice class for sending email using smtp. hope it helps-James Mutuku Share this post Link to post Share on other sites
iGuest 3 Report post Posted August 4, 2008 How to send mail using gmail as a smtp server Php Send Mail Through Smtp Hi I tired a lot of scripts to send mail throug smtp and no one of them was working correctly. One of them sends mail to spam because there were no authentication. One of them worked cool but after sending 30-40 mail gave me an error Error: Language string failed to load: connect_host now I'm mixed up and really need a mail sender that it really work Thanks a lot Masoudmpour@yahoo.Com -reply by Bardiya Share this post Link to post Share on other sites
turbopowerdmaxsteel 0 Report post Posted August 6, 2008 I have been using phpMailer for quite sometime. However, for some reason, it is unable to send mail anymore. I don't recall changing any of the configurations either. I was using gmail as the SMTP server. But now, I have switched back to the mail function, which always works. Share this post Link to post Share on other sites
iGuest 3 Report post Posted April 27, 2009 cannot send mail trough phpPhp Send Mail Through Smtp hello every one . could anyone just give me the direct code which sends the mail from a smtp. I have alredy used phpmailer() but is nt wrking for me it gives some error as smtp error : mail not accepted by the (abc@gmail.Com ) . This is the example id not the real one. Please help-question by Pramod Share this post Link to post Share on other sites
ygadiya2000 0 Report post Posted May 11, 2009 I am a new member here, but I am using PHP from long time .I have used SendMail on windows system.Also have knoledge to work on linux systemSolution: First you have to download Sendmail utility. Make changes in php.ini and sendmail.ini files. PHP.ini 1. set path of sendmail.exe file. example: sendmail_path = "C:\wamp\sendmail\sendmail.exe -t" 2. disable smtp by puting ";" in front of SMTP= example : ;SMTP = localhost sendmail.ini 1. Make setings of smtp port example : smtp_port=25 2. set smtp server name example: mail.domain.com 3. Set pop3 server name example : pop3_server=mail.domain.com 4. Set POP3 user name example : pop3_username=username@domain.com 5. Set Password example : pop3_password=****** Now restart apache server. and all is set.Hope this helps you and every thing works fineHere is attachment for Regards------------Yogesh GAdiya Share this post Link to post Share on other sites
sagardash 0 Report post Posted December 17, 2009 I am a new member here, but I am using PHP from long time .I have used SendMail on windows system.Also have knoledge to work on linux systemSolution: First you have to download Sendmail utility. Make changes in php.ini and sendmail.ini files. PHP.ini 1. set path of sendmail.exe file. example: sendmail_path = "C:\wamp\sendmail\sendmail.exe -t" 2. disable smtp by puting ";" in front of SMTP= example : ;SMTP = localhost sendmail.ini 1. Make setings of smtp port example : smtp_port=25 2. set smtp server name example: mail.domain.com 3. Set pop3 server name example : pop3_server=mail.domain.com 4. Set POP3 user name example : pop3_username=username@domain.com 5. Set Password example : pop3_password=****** Now restart apache server. and all is set.Hope this helps you and every thing works fineHere is attachment for Regards------------Yogesh GAdiya Hi in windows we need to install any SMTP server or not..if yes please give me all the steps of sending mail through php in windows platform...i mean the smtp software name...and steps to do that..i did all the steps what u wrote...but i think thts not enough ...please help me i am new to PHP... Share this post Link to post Share on other sites
yordan 10 Report post Posted December 17, 2009 Hi in windows we need to install any SMTP server or not..if yes please give me all the steps of sending mail through php in windows platform...i mean the smtp software name...and steps to do that..i did all the steps what u wrote...but i think thts not enough ...please help me i am new to PHP...Please avoid double-posting, your question looks strangely similar to the one you asked here : http://forums.xisto.com/topic/97384-topic/?findpost=1064405010 Regardsyordan Share this post Link to post Share on other sites