SMTPSendMail and Links with Spaces In Them

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ueberyak
Junior Coder
Posts: 31
Joined: Tue Sep 03, 2013 9:45 pm

SMTPSendMail and Links with Spaces In Them

Post by ueberyak » Wed Nov 27, 2013 6:40 pm

I am sending an email using SMTPSendMail and have a link included in the body, however the link has spaces in it so when the email gets sent, the link doesn't work properly. Is there some way to force Macro Scheduler to interpret the entire link properly?
Thanks,
Josh

ueberyak
Junior Coder
Posts: 31
Joined: Tue Sep 03, 2013 9:45 pm

Post by ueberyak » Wed Nov 27, 2013 7:26 pm

It works when I put quotes around it, but I don't like how it looks in the email, because the quotes get displayed. I can do it this way if I must, though.
Thanks,
Josh

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Nov 28, 2013 9:20 am

Do you mean web links? URLs?

You might need to URL encode your links. A space is %20.

So you could do:

Code: Select all

StringReplace>URL,SPACE,%20,URL
Or better to URL encode it:

Code: Select all

Let>url=http://www.boo.bla?spaces are evil
VBEval>Escape("%url%"),url
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

ueberyak
Junior Coder
Posts: 31
Joined: Tue Sep 03, 2013 9:45 pm

Post by ueberyak » Tue Dec 03, 2013 5:08 pm

%20 worked, thank you!

Is there an easy way to use html so that the link has display text, e.g. Link text? It's a network address so it's something like \\server\folder\sub%20folder.
Thanks,
Josh

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts