[Mr. MAK] Implement Mailbox validation---Send mail in the Laravel framework

Source: Internet
Author: User
Tags email account

After a period of use, found in the project many places need to use user authentication, SMS verification and mailbox verification as the mainstream trend, wheat summed up if the Laravel framework to implement the sending mail function, will be more on how to implement SMS verification later on.

      

Under the. env file

1. Configuring the Laravel File

MAIL_DRIVER=SMTP//SMTP method recommended

Mail_host=smtp.163.com//Suggested use 163 mailbox QQ mailbox will have an error

MAIL_PORT=25//SMTP defaults to 25

Mail_username=null//Own 163 account

Mail_password=null//Client password

Mail_encryption=null

.

2. Modify the config/email.php file in the

' From ' + [' address ' = null, ' name ' = null],//not indicated on the manual, but the actual application if the Addredd=>null is error, need to write their own 163 address

3. Register 163 mailbox and make email account settings pop3/smtp/imap to open and activate the authorization code and verify the phone

4. Refer to the e-mail sent in the Laravel manual

It is important to note that the use mail must be referenced first when the controller refers to a message being sent

?    ?    ? ? send a message test

?    ?    ? ? set in the route

      

?    ?    ? ? write methods in the controller

                

?    ?    ?    ?    ?    ?    ?    ?    ?    ?    ? ? where

?    ?    ?    ?    ?    ?    ?    ?    ?    ?    ?    ? 1:mail::raw is the delivery of native data, and other ways of sending content are provided in the manual;

?    ?    ?    ?    ?    ?    ?    ?    ?    ?    ?    ? ? 2. $message->subjuet ("); is the title of the file

?    ?    ?    ?    ?    ?    ?    ?    ?    ?    ?    ? ? 3. $message->to (); Send to whom

?    ? ?

This is a $message list of methods that can be used in a message generator instance:

$message->From($address,$name=Null);$message->Sender($address,$name=Null);$message->To($address,$name=Null);$message->Cc($address,$name=Null);$message->Bcc($address,$name=Null);$message->ReplyTo($address,$name=Null);$message->Subject($subject);$message->Priority($level);$message->Attach($pathToFile,Array$options=[]);Append a file to the original $data string ...$message->attachdata ( $data  $name array  $options = []; Get the underlying Swiftmailer message instance ...  $message ->getswiftmessage (              

?    ?    ?    ?    ?    ?    ?    ?    ?    ? ?

?    ?    ?    ? ?

[Mr. MAK] Implement Mailbox validation---Send mail in the Laravel framework

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.