在短信电子邮件中添加超链接

adding a hyperlink in a sms email

我想做的是从我的网站通过电子邮件发送注册确认短信。我现在可以使用它,但我想确保人们输入正确的 phone 号码和运营商数据。当我的消息发送时,它会发送 link 这个词,但它不可点击 有没有办法让 link 可点击?

到目前为止,这是我的代码。

    <?php



$to = $mobil.$carier;
$subject = 'Registration for'.$school .'Scholarships Page';

$message = "
<html>
<head>
<title>Registration Email</title>
</head>
<body>
<h1>Email Registration Confirmation</h1>
<p>Welcome".$first_name." ". $last_name."
<p>In order to finish your registration for the scholarship site you need a valid 
text phone number. 
<p>Please Click the link given to confirm your registration.</p>
<a href=\"http://scholarship_domain/scholarships/activate.php?id=".$active_mobil ."\">Link 
</a>
<p>If you have problems please contact your counsellor at your school. </p>
</body>
</html>
";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <scholarships.gnspes.ca>' . "\r\n";


mail($to,$subject,$message,$headers);



?>

现在发生的情况是消息已发送,但 link 不可点击,消息中仅显示“link”字样。我想我可以把它变成一个人可以复制和粘贴的 link,但我想知道是否有办法让它成为真正的 hyperlink?

感谢您的帮助。

向 phone 号码发送电子邮件或短信时,消息会自动更改为 phone 上的 html。我能够使用以下代码向自己发送可点击的 link,但我建议将它发送的消息缩短一点,因为此消息必须作为图片消息发送。我只使用 0000000000@vtevt.com 将它发送给自己并且它有效但是消息太长无法显示所有信息所以我只发送了 link 部分并且它有效。

<?php

$to = $mobil.$carier;
$subject = 'Registration for '.$school .' Scholarships Page';

$message = '
Email Registration Confirmation
Welcome '.$first_name.' '. $last_name.'
In order to finish your registration for the scholarship site you need a valid 
text phone number.
Please Click the link given to confirm your registration.
http://scholarship_domain/scholarships/activate.php?id='.$active_mobil .'
If you have problems please contact your counsellor at your school.
'; 
$message = str_replace("\n.", "\n..", $message);
// Always set content-type when sending HTML email
//$headers = "MIME-Version: 1.0" . "\r\n";
//$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
//$headers .= 'From: <scholarships.gnspes.ca>' . "\r\n";

mail($to,$subject,$message);

?>

此外,如果您要将短信发送到那里,则无需在短信中发送 headers。而且这个主题在文本中不起作用。它仅显示发送邮件的电子邮件或网站。