Page 1 of 1

Using & for URL parameter?

Posted: Wed Oct 01, 2008 10:31 am
by seodevhead
Hey guys,

First off... love SwiftMailer.

Gotta question about how to craft my plain text and HTML messages.

The email that I am sending will include a URL link like the following:

http://www.mysite.com/page.php?x=12&y=34

When I craft my plain text and html message to put into the SwiftMailer $message->attach(new Swift_Message_Part($plainTextVersion)) and .. {repeat}.. ift_Message_Part($htmlVersion))...

..do I need to write the ampersand in the URL as '&', or do I write it as '&'? I don't know whether I need to use the HTML equivalent or not. I am having problems with my emails getting sent to junk folders and didn't know if this could be a culprit.

IE: Which one?

1) $plainTextVersion = 'Blah Blah Blah\n\nhttp://www.mysite.com/page.php?x=12&y=34';
- or -
2) $plainTextVersion = 'Blah Blah Blah\n\nhttp://www.mysite.com/page.php?x=12&y=34';

Thanks for any help!

Re: Using & for URL parameter?

Posted: Wed Oct 01, 2008 12:29 pm
by andyhoneycutt
I've had success with both, but results may vary depending on the end-user's browser.

-Andy

Re: Using & for URL parameter?

Posted: Wed Oct 01, 2008 2:42 pm
by califdon
& is a special HTML character, for use in HTML documents to be rendered on the browser screen. URLs are entirely different, not part of HTML standards.