Embed URL Link in SMS via PHP

随声附和 提交于 2019-12-08 15:26:22

问题


Is there a way I can embed a URL link i.e. <a href='www.google.com'>google</a> in an SMS message send through [myphonenumber]@txt.att.net ? My mail configuration is set to "text/html" but the link shows up as un-clickable plain text in the SMS...

Any Ideas?!!?


回答1:


Most phones will automatically linkify URLs, however it is not possible to give links the way you are trying to do. Simply send www.google.com and the receiving device will link it for you.




回答2:


No, clickable links are dependent on the phone. Some phones will parse the SMS and make links "clickable", others won't.




回答3:


SMS reader is NOT a webbrowser. Expecting a phone to render an SMS as a web page is pushing things.

Some phones have some smarts and will linkify URLs if they're spotted in there, but that's dependent on the phone.




回答4:


Don't use HTML in your SMS message. SMS messages are supposed to be just text.

However, many handsets will make a URL interactive, just as text-only emails can have clickable in Outlook or GMail.

Remember:

  • Some handsets wont format the url in any special way so make sure the URL is easy to type out
  • It's general etiquette to allow people to unsubscribe. The last thing you want to do is spam people
  • SMS messages are restricted to 140 chars each so be careful of the URL size. You can go over that limit but it might become expensive.

So your SMS message should look something like this:

We have some great bargains. Log in at http://www.google.com or reply UNSUB




回答5:


There are a lot of smartphones these days that might parse your HTML into a more intuitive, web browser kind of way, but this is not a good practice. You must use the URL or a better solution is create a tiny URL of your URL and send it in the SMS, this would save you a lot of characters. There is a wide range of URL shortening websites available, like bit.ly, goo.gl, ow.ly, tinyurl.com, etc.



来源:https://stackoverflow.com/questions/7096212/embed-url-link-in-sms-via-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!