【发布时间】:2017-10-21 00:36:04
【问题描述】:
我有一个场景,我正在运行一个短信活动,其中每个短信都包含一些带有链接的文本。此链接是动态的,并且对于基于用户的每个短信都是不同的。 我的短信内容——“亲爱的用户,请click here进行活动。”
下面是我正在使用的代码。
$smsusername = 'xxxxxx';
$smspassword = 'xxxxxx';
$destination = $phone;
$url = "http://www.example.com/?id=1"
$source = 'SENDER-NM';
$text1 = 'Dear User, Please ';
$parturl = '<a href="$url">click here </a>';
$text2 = 'to perform the activity.';
$text = $text1 . $parturl . $text2;
$content = 'action=sendsms'.
'&user='.rawurlencode($smsusername).
'&password='.rawurlencode($smspassword).
'&to='.rawurlencode($destination).
'&from='.rawurlencode($source).
'&text='.rawurlencode($text);
$smsglobal_response = file_get_contents('http://www.smsglobal.com.au/http-api.php?'.$content);
$explode_response = explode('SMSGlobalMsgID:', $smsglobal_response);
我在哪里做错了。请指教
【问题讨论】:
-
似乎是您的短信以纯文本形式发送,请提供有关您的短信 API 的更多详细信息或联系该 API 支持团队。
-
@hassan : 我在这里使用 smsglobal 的 api 来发送短信。这是它的文档 - smsglobal.com/http-api/…
-
很难找到任何关于在那里发送 HTML 内容的线索,我认为他们不支持 HTML ,即使使用 email-api smsglobal.com/services ,你会发现“确保邮件正文是纯文本,不是 HTML。”