On Sat, Aug 21, 2010 at 11:27 PM, Hugo Arts <[email protected]> wrote:

>
> The variable is inserted just fine for me, though there's some
> problems with the <a> tag, because you shouldn't surround GET
> variables with quotation marks, e.g. you should do this:
>
> http://example.com/?ecn=423434
> NOT this:
> http://example.com/?ecn="423434";
>
> If you do this, the HTML parser will encounter the first ", think that
> it's come to the end of the href="" attribute, and ignore the rest.
> But that's an HTML issue, not a python one.
>
> As an aside, consider using string formatting operations like so:
>
> newMail.HTMLBody = """
> <pre>
> ECN number {0} on Project {1} has been closed.
> Below is a link to the ECN on the intranet.
> <a 
> href="http://web_server_at_work.com/cgi-bin/part-url.cgi?ecn={0}<http://web_server_at_work.com/cgi-bin/part-url.cgi?ecn=%7B0%7D>
> ">{0}</a>
> ECN Description:
> {2}""".format(pecn, pecn_project, pdesc)
>
>
> Hugo,

Thank you for the reminder of the problem with the HTML.  I see that now.
You are right, however, using that format method works wonderfully and is
definitely the way to go!   I see how I can apply that in lots of ways.

Thanks for the help,
Bill
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to