| | Can anyone here tell me how to send mail through SMTP server with php |
| Nov 20, 2009 |
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 Astahost.
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
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. 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 bro if ya have anysite be da same plz post it thx
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
Get phpMailer .It's a nice class for sending email using smtp.
hope it helps -James Mutuku
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
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.
cannot send mail trough php
Php 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
Similar Topics
Keywords : php, send, mail, smtp
(5) While the mail() function of php is all bout simplicity, it lacks the otherwise necessary (4) I just coded this e-mail list, it works well for entering data into database, but if user leaves Can't find a decent tutorial! (6) I read the one mail() tutorial that was posted in the tutorial section and to my horror found that Possibility of sending a newsletter (12) Task : To send an email to a list of email addresses stored in a database Premise : Page is check for correct address and syntax (2) Hey , this tutorial will tell you a very simple way to check if email addresses entered are with the (2) Notice from m^e: Repeat post. Credits reduced by 5 days. Learn to USE (8) Just sends all form data to a specified email. Does anyone know a free script that does this?.... (4) I'm trying to use the mail() function in a script. But it doesnt work. It keeps returning false. (4) I am programming on a web site's contact form page, How can I mail the filled in information of Looking for php, send, mail, smtp
|
![]() Php Send Mail Through Smtp |
Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com