dopq87915 2014-04-28 15:36
浏览 37
已采纳

注册后发送电子邮件[复制]

This question already has an answer here:

I have a member system and have created a function where you need to active your account by email.

It succesfully sends emails, but the problem is you see the email in 'From' in your inbox.

I want to sent the email by no-reply@mysite.com from:SITE NAME subject:SUBJECT I can't do both sent and from

I got this now:

public function sendActivation($to, $subject, $body) {
    mail($to, $subject, $body, 'From: SITE NAAM', 'From: EMAIL@site.com');
}

An email is sent after registration of an account with success:

User::sendActivation(Input::get('email'), 'Email verification', 'okeoke');
</div>
  • 写回答

1条回答 默认 最新

  • droirqk4795 2014-04-28 15:43
    关注

    If you want to specify both sender and sender's name, replace the headers with this:

    'From: SITE NAAM <no-reply@mysite.com>'
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作