大家好,我正在开发网络应用程序,用于在用户输入电话号码时发送彩信。我成功地能够以 HTML 形式发送带有图像的电子邮件。现在,我正在尝试通过 PHP 邮件功能向我的客户发送彩信,但他们收到的唯一内容是我随消息一起发送给他们的链接。到目前为止,这是我想出的。
<?php
$email = '1234567890@somenetwork.domain';
$link = $_COOKIE["coupon"];
$to = $email;
$subject = 'Some Subject';
$message = " Hello, This is Testing Text 8.0
<a href=\"https://encrypted-tbn0.gstatic.com/images? \
q=tbn:ANd9GcS0dA2aipmy9hwAitgD8U5n8l_afNBvxYc3gnOFi7hOGoGAGIHssw\">Your Link</a> ";
$message->addAttachment("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS0dA2aipmy9hwAitgD8U5n8l_afNBvxYc3gnOFi7hOGoGAGIHssw", "image/gif");
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: someone <support@someone.com>' . "\r\n";
mail($email, $subject, $message, $headers);
?>