Hyperlinks

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
gph1
Forum Newbie
Posts: 5
Joined: Sun Oct 14, 2007 3:14 am

Hyperlinks

Post by gph1 »

I am trying to add a couple of hyperlinks to outgoing emails. I'm sending HTML format and just typing in the URL in the text msg.
The only client displaying the link is Outlook 2007. All other versions of Outlook and all other mail clients are just seeing text. How do I fix this?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

If you're sending in HTML format, and just typing the URLs as text, it is up to the mail client to render them. Some do it automatically, some do not. You should be wrapping your links in <a href="link">link</a> tags to ensure that the client will display them as a link.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
gph1
Forum Newbie
Posts: 5
Joined: Sun Oct 14, 2007 3:14 am

Post by gph1 »

Sorry, yes I've tried that and yes I've used escape characters for the quotes. Thunderbird will not display as links when I do that.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Example?
gph1
Forum Newbie
Posts: 5
Joined: Sun Oct 14, 2007 3:14 am

Post by gph1 »

Code: Select all

//Create the message
    $message =& new Swift_Message("A Puzzle", "Greetings.<br/><br/>Someone you know requested that I send this puzzle to you. <br/> The puzzle is free for everyone to enjoy and or share with family and friends. <br/>I am a freelance illustrator having worked for over 30 years creating art for children.<br/>Have fun.<br/><br/>Joe Smith<br/><br/> <a href=\"www.something.com\">something.com</a> <br/> <a href=\"www.something.com/main-pages/Puzzle-page.html\">Puzzle Page</a> <br/><br/> P.S.  If your friend included a note to you it will follow here: <br/> $commentstofriend");
	$message->setContentType("text/html");
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Your hyperlinks are not valid absolute URLs. Thunderbird is probably treating them as a security risk. Prefix the http:// part onto them.
gph1
Forum Newbie
Posts: 5
Joined: Sun Oct 14, 2007 3:14 am

Post by gph1 »

Thank you for your help, that worked.
Post Reply