绿站
绿色文摘
今天是:

交流 | 搜索 | +发贴

WordPress纯代码免插件配置SMTP邮件功能
nydalu 2024年5月28日 230次

目前很多虚拟主机基本都是禁用了mail函数的,所以我们只能使用SMTP服务发送邮件,网上关于STMP的WordPress插件有很多,将下面代码修改后复制到functions.php文件,再测试发送邮件功能。

//WordPress免插件配置SMTP邮件
function mail_smtp( $phpmailer )
{
$phpmailer->FromName = \’生存无忧\’; //发件人名称
$phpmailer->Host = \’smtp.qq.com\’; //修改为你使用的邮箱SMTP服务器
$phpmailer->Port = 465; //SMTP端口
$phpmailer->Username = \’k1510@qq.com\’; //邮箱账户
$phpmailer->Password = \’*****\’; //邮箱授权码(此处填写QQ邮箱生成的授权码)
$phpmailer->From = \’k1510@qq.com\’; //邮箱账户
$phpmailer->SMTPAuth = true;
$phpmailer->SMTPSecure = \’ssl\’; //tls or ssl (port=25时->留空,465时->ssl)
$phpmailer->IsSMTP();
}
add_action(\’phpmailer_init\’, \’mail_smtp\’);


  • drover sointeru 25-01-01 18:21  

    Heya i’m for the first time here. I found this board and I find It really useful & it helped me out a lot. I hope to give one thing back and aid others such as you aided me.

    https://www.droversointeru.com


  • https://Menbehealth.wordpress.com/ 25-03-27 00:43  

    I drop a leave a response each time I appreciate a poist on a site or if I
    have somethihg to add to the discussion. It’s a result of the passion communicated
    in the post I read. And on this article WordPress纯代码免插件配置SMTP邮件功能 –
    绿站. I was actually moved enough to drop a comment 😉 I
    do have 2 questions for you if it’s allright. Is it just mee or do some of theese responses come across as if they are coming from
    brain dead visitors? 😛 And, if you are posting
    at additional social sites, I would like to fokllow you.
    Woild you list the complete urls of all your community
    pages like your Facebook page, twitter feed, or linkedin profile? https://Menbehealth.wordpress.com/


  • 📑 + 1.325473 BTC.GET - https://graph.org/Message--120154-03-25?hs=4dde8ed13d434561740f485109f1356b& 📑 25-04-02 18:16  

    vm9u1b


  • droversointeru 25-04-10 22:40  

    I couldn’t resist commenting

    https://www.droversointeru.com


  • 📎 Message; SENDING 1.674826 BTC. Get =>> https://graph.org/Ticket--58146-05-02?hs=4dde8ed13d434561740f485109f1356b& 📎 25-05-13 20:01  

    esl2ms


  • 📇 + 1.530410 BTC.GET - https://yandex.com/poll/T1TnDbUc4R9aLX7Nzhj1Cy?hs=4dde8ed13d434561740f485109f1356b& 📇 25-05-19 01:32  

    m9mhzu


  • zoritoler imol 25-05-21 08:26  

    As I website possessor I conceive the subject matter here is really fantastic, thanks for your efforts.

    https://www.zoritolerimol.com



  • 关于 ·登录·管理
    加载18.717 查询 16