douyabu1528 2015-01-30 23:43
浏览 10
已采纳

PHP邮件程序从NAME更改

I have managed to send a mail to myself using this code.

    $mail = new PHPMailer;
    //$mail->SMTPDebug = 1;

    //Email server info
    $mail->isSMTP();
    $mail->Host = 'smtp-mail.outlook.com';
    $mail->SMTPSecure = 'tls';
    $mail->Port = 587;

    //User authentication info
    $mail->SMTPAuth = true;
    $mail->Username = '******@hotmail.com';
    $mail->Password = '********';

    //Email info
    $mail->From = 'noreply@ledii.net';
    $mail->FromName = 'LediiNet';
    $mail->addAddress($mail->Username);
    $mail->Subject = 'LediiNet Feedback';
    $mail->Body = 'Here are some thoughts...';

Is it possible to make it so that the mail will show up with my website name as sender insteath of my name and email?

I would preferrably want it to seem like the mail is sent from noreply@ledii.net and with the sender name of LediiNet.

I feel like I probably have to actually create that email somehow and connect to my host servers email server info?

  • 写回答

1条回答 默认 最新

  • douejuan9162 2015-02-07 17:22
    关注

    I figured out how to do it, but I had to change to using the mail() function and modify my local files for it to work locally.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题