


Introduction to how to use 163 mailbox to send emails in laravel5.4
Sending emails is an essential requirement that we encounter in daily development. The following article mainly introduces you to the steps of using laravel5.4 to send emails using the 163 mailbox. The article introduces it through sample codes and pictures. Very detailed, friends in need can refer to it.
Preface
In fact, sending an email is not difficult, rather it is quite simple. This article will introduce in detail about laravel5.4 using 163 email to send The relevant content of the email is shared for everyone’s reference and study. I won’t go into details below, let’s take a look at the detailed introduction.
1. First, register an account with 163 now and set it up as shown below
2. If you have done all the above, then the next step is to configure .env
MAIL_DRIVER=smtp MAIL_HOST=smtp.163.com MAIL_PORT=465 MAIL_USERNAME=你的账号@163.com MAIL_PASSWORD=你的客户端授权密码 MAIL_FROM_ADDRESS=你的账号@163.com MAIL_FROM_NAME=账号名 MAIL_ENCRYPTION=ssl
3. Then continue The next step is to configure routing and write the method of sending emails on the controller
Route::get('mail/send','CommonController@send');
public function send() { $name='学院君'; $flag= Mail::raw('你好,我是PHP程序!',function($message) { $to='你的qq邮箱@qq.com'; $message->to($to)->subject('纯文本信息邮件测试'); }); if(!$flag){ echo '发送邮件成功,请查收!'; }else{ echo '发送邮件失败,请重试!'; } //以上是纯文本,下面则是附带文件发送 // $flag = Mail::send('emails.test',['name'=>$name],function($message){ // $to = '你的qq邮箱@qq.com'; // $message->to($to)->subject('text'); // // $filePath = 'storage/exports/'.iconv('UTF-8', 'GBK', '学生成绩').'.xls'; // $attachment = storage_path('app/files/test.txt'); // //在邮件中上传附件 // $message->attach($attachment,['as'=>'text.txt']); // }); //下面是发送邮件附带图片的 // $imgPath = 'http://laravelacademy.org/wp-statics/images/carousel/LaravelAcademy.jpg'; // $flag = Mail::send('emails.test',['name'=>$name,'imgPath'=>$imgPath],function($message){ // $to = '你的qq邮箱@qq.com'; // $message ->to($to)->subject('网络图片测试'); // }); // if(!$flag){ // echo '发送邮件成功,请查收!'; // }else{ // echo '发送邮件失败,请重试!'; // } }
PS: The key point is to get the error reporting process right. Basically, if you follow the steps, there won’t be any big problems. However, the most important thing is what I use. It is done on Ubuntu16.04 system. The permission issues should be solved first, so I suggest giving permission first and opening the command line in your directory: sudo chmod 777 -R ./
$options['ssl']['verify_peer'] = FALSE; $options['ssl']['verify_peer_name'] = FALSE;
Summary
The above is the detailed content of Introduction to how to use 163 mailbox to send emails in laravel5.4. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



This article provides a detailed Gate.io registration tutorial, covering every step from accessing the official website to completing registration, including filling in registration information, verifying, reading user agreements, etc. The article also emphasizes security measures after successful registration, such as setting up secondary verification and completing real-name authentication, and gives tips from beginners to help users safely start their digital asset trading journey.

This article provides newbies with detailed Gate.io registration tutorials, guiding them to gradually complete the registration process, including accessing the official website, filling in information, identity verification, etc., and emphasizes the security settings after registration. In addition, the article also mentioned other exchanges such as Binance, Ouyi and Sesame Open Door. It is recommended that novices choose the right platform according to their own needs, and remind readers that digital asset investment is risky and should invest rationally.

Method for obtaining the return code when Laravel email sending fails. When using Laravel to develop applications, you often encounter situations where you need to send verification codes. And in reality...

The method of handling Laravel's email failure to send verification code is to use Laravel...

This article provides a detailed Gate.io web version latest registration tutorial to help users easily get started with digital asset trading. The tutorial covers every step from accessing the official website to completing registration, and emphasizes security settings after registration. The article also briefly introduces other trading platforms such as Binance, Ouyi and Sesame Open Door. It is recommended that users choose the right platform according to their own needs and pay attention to investment risks.

This article provides a complete guide to login and registration on Binance PC version. First, we explained in detail the steps for logging in Binance PC version: search for "Binance Official Website" in the browser, click the login button, enter the email and password (enable 2FA to enter the verification code) to log in. Secondly, the article explains the registration process: click the "Register" button, fill in the email address, set a strong password, and verify the email address to complete the registration. Finally, the article also emphasizes account security, reminding users to pay attention to the official domain name, network environment, and regularly updating passwords to ensure account security and better use of various functions provided by Binance PC version, such as viewing market conditions, conducting transactions and managing assets.

Detailed explanation of database ACID attributes ACID attributes are a set of rules to ensure the reliability and consistency of database transactions. They define how database systems handle transactions, and ensure data integrity and accuracy even in case of system crashes, power interruptions, or multiple users concurrent access. ACID Attribute Overview Atomicity: A transaction is regarded as an indivisible unit. Any part fails, the entire transaction is rolled back, and the database does not retain any changes. For example, if a bank transfer is deducted from one account but not increased to another, the entire operation is revoked. begintransaction; updateaccountssetbalance=balance-100wh

As the world's leading digital asset trading platform, Ouyi OKX attracts many investors with its rich trading products, strong security guarantees and convenient user experience. However, the risks of network security are becoming increasingly severe, and how to safely register the official Ouyi OKX account is crucial. This article will provide the latest registration portal for Ouyi OKX official website, and explain in detail the steps and precautions for safe registration, including how to identify the official website, set a strong password, enable two-factor verification, etc., to help you start your digital asset investment journey safely and conveniently. Please note that there are risks in digital asset investment, please make cautious decisions.
