No email server is required, and no built-in functions of mail are used. a class can be used. Using the phpmailer class, I wrote a custom function sendmail (), which is practical! I used to post this email function on several php forums. I will try again today... no email server is required, and no built-in functions of mail are used. a class can be used. Using the phpmailer class, I wrote a custom function sendmail (), which is practical!
I used to post this email function on several php forums. I will send it again today, because I want to attach a use example to today. if you still don't use it, I need to complete the php basic course.
1. prepare the sendmail. class. php file and phpmailer class download files.
2. after downloading, decompress phpmailer.rar to any directory on the server.
3. open sendmail. class. php and modify it as follows (the light yellow part is the variable value that must be modified)
// The following five variable values must be modified based on actual $ host = '61. 183.41.172 '; $ username = 'admin @ php95.com'; $ password = "******" $ from = 'admin @ php95.com '; $ fromname = 'tianma blog '; // set the value of the $ to $ subject $ content variable first, and then call the sendmail function to send an email $ to = 'nt2030 @ qq.com '; $ subject = 'Test phpmailer class to send mails '; $ content = 'Test phpmailer class to send mails'; sendmail ($ to, $ subject, $ content );
4. run sendmail. class. php after modification ..
Are your emails sent successfully? Tianma tests this code, is OK, witness:
Address:
Reprinted at will, but please attach the article address :-)