. In short, Gmail's SMTP server is great for your personal use, but not for commercial bulk mail.Having said that, it's time to show you how to use Gmail's SMTP server in a Linux environment.Google Gmail SMTP server SettingsIf you want to send mail through your app using Gmail's SM
. In short, Gmail's SMTP server is great for your personal use, but not for commercial bulk mail. Having said that, it's time to show you how to use Gmail's SMTP server in a Linux environment.Google Gmail SMTP server SettingsIf you want to send mail through your app using Gmail's S
. When you reach any limit, your Gmail account will be temporarily locked for one day. In short, the SMTP server of Gmail is very good for your personal use, but it is not suitable for Commercial batch mail.
Now, it's time to show you how to use Gmail's SMTP server in Linux.
Google
Phpmailer version used: 5.2.1
The following are some of the code given in the example folder of Phpmailer: test_gamil_basic.php.
The code is as follows
$mail = new Phpmailer (); $body = file_get_contents (' contents.html '); $body = $_post[' body ']; $body = Eregi_replace ("[]", ", $body); $mail-gt;issmtp (); Telling the class to use SMTP $mail-gt;smtpdebug = 2; Enables SMTP
Phpmailer version used: 5.2.1The following are some of the code given in the example folder of Phpmailer: test_gamil_basic.php.
The code is as follows
Copy Code
$mail = new Phpmailer ();$body = file_get_contents (' contents.html '); $body = $_post[' body '];$body = Eregi_replace ("[]", ", $body);$mail->issmtp (); Telling the class to use SMTP$mail->smtpdebug = 2; Enables SMTP d
TIPS:
SMTP and POP3 In Gmail are both SSL-encrypted.
Step1. PHP OpenSSL module (Extension) Support
Step2. download phpmailer Library
Step3. change code 'class. phpmailer. php' and 'class. SMTP. php'
Add property is_ssl (VAR $ is_ssl = false;) to phpmailer and SMTP ;)
The smtpconnect method in phpmailer i
; // key point. An ID value is obtained here.// Message. attachments. Add (Attachment); // you can add multiple attachments.
Smtpclient client = new smtpclient ();Client. Host = strsmtpserver; // set the host name or IP address of the SMTP transactionClient. Port = intport; // port numberClient. usedefacrecredentials = true;Client. deliverymethod = smtpdeliverymethod. Network;Client. enablessl = true; // After SSL encryption, The
Include("Class. phpmailer. php");// Imports phpmailer class to others
$ Mail=NewPhpmailer ();// Create a new object
$ Mail-> Issmtp ();// Set the SMTP mode for sending messages
$ Mail-> Smtpauth = true;// You need a license to set SMTP.
$ Mail-> Smtpsecure ="SSL";// The SMTP host of Gmail needs to use SS
Laravel4and Laravel5Messages are sent in exactly the same way. Laravel5The mail is sent in Chinese document in: http://Laravel-china.org/docs/5.0/mailIn this article, I will163The mailbox, for example, shows how to send a message using the Laravel built-in mail delivery class.ConfigurationModify the Mail send configuration.4.2In app/config/mail.php,5In config/mail.php, modify the following configuration:'Host'='smtp.163.
does not support secure connections. I set up client for the//secure connection. Enablessl = True; errors that occurred after
Workaround : method One is set to "client." Enablessl = False "or remove this line of codeMethod two open secure connection service
Error Three: The SMTP server requires a secure connection or the client is not authenticated. The server response is: Authentication requiredStack tr
The number of emails sent in the past few days is small.ProgramBy the way, I checked why SMTP mail servers such as 126 and Gmail cannot use the SMTP commands in the lab class to send emails. At that time, based on the returned information, I only knew that the server needed identity authentication.
Today, I finally f
Use smtp.163.com to send mail (local serverless) Step 1: Download phpmailerfile package phpmailer-1.73.tar.gz from open source community: http://phpmailer.sourceforge.net/
Step 2: Check whether your server system supports socket, for example, phpinfo ();
If you do not have this option, note that socket is an extension of PHP, and a configuration option for./configure -- enable-sockets must be given during c
Step 1: Download phpmailerfile package phpmailer-1.73.tar.gz from Open Source
Community : Http://phpmailer.sourceforge.net/
Step 2: Check whether your server system supports socket, for example, phpinfo ();
If you do not have this option, note that socket is an extension of PHP, and a configuration option for./configure -- enable-sockets must be given during compilation.
Step 3: extract the file to your web server directory and call the class. Note: The class is included first. phpmailer. PHP,
Step 1: Download phpmailerfile package phpmailer-1.73.tar.gz from open source community: http://phpmailer.sourceforge.net/Step 2: Check whether your server system supports socket, for example, phpinfo ();If you do not have this option, note that socket is an extension of PHP, and a configuration option for./configure -- enable-sockets must be given during compilation.Step 3: extract the file to your web server directory and call the class. Note: The class is included first. phpmailer. php, creat
Smtp
1. Introduction
Next week, need to do a send email module, Maito, the weekend at home to do a test, Microsoft, There is System.Web.Mail space in the net1.1, this namespace can send e-mail without SMTP authentication, but now there is very little on the network do not need SMTP
PHP authentication via SMTP mail login method, PHPSMTP mail authentication
This article explains how PHP logs on through SMTP mail verification. Share to everyone for your reference, as follows:
Intranet system in order to unify the account, all use the mail account login way, so there are the following procedures
/**
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.