dongnanke4106 2015-11-14 12:08
浏览 104
已采纳

使用php向雅虎发送邮件

I'm trying to send an email (with clickable link), I can receive the message but I can't click on the link it's like a text that you can't click on it !
And I get this problem only with yahoo account I try it with gmail and it works fine!
This is my php code:

$to  = 'test@example.com';//$email;

// subject
$subject = 'subject';//'Activation account';

// message
$message = '<html>
            <head>
              <title>Activation account</title>
            </head>
            <body>
            <p>Thank you for subscribing to our site, please click on the link below to activate your account:</p>
            <a href="httm://www.google.com" style="font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif;display: inline-block;color: #FFFFFF;background-color: #8AC007;font-size: 15px;text-align: center;padding: 5px 16px;text-decoration: none;margin-left: 0;margin-top: 0px;margin-bottom: 5px;border: 1px solid #8AC007;white-space: nowrap;">
                Activate my account
            </a> /*styled link is not working*/
            <br>        
            <a href="www.google.fr">google</a> /* even a simple link is not working*/
            </body>
            </html>';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=utf-8' . "
";

// Additional headers
$headers .= 'To: name <name@test.com>' . "
";
$headers .= 'From: origin <contact@example.com>' . "
";

// Mail it
mail($to, $subject, $message, $headers);
  • 写回答

1条回答 默认 最新

  • dongmao3131 2015-11-14 13:07
    关注

    I just solved it... it seems that i must write the complete link with the 'http://' I dunno why only yahoo needs this format. it was working fine with gmail and hotmail.

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

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?