Discussion Locked

Long URL links in E-Mail Messages

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
We have a VB application that creates e-mail messages containing a URL that points to UPS and has tracking number information. The URL is long and we'ver noticed that some browsers don't seem to recognize that the URL continues on the next line. It looks like the e-mail message coming from our VB app has a right margin and only allows the message to be a certain width. We can find no place to specify a line length or number of characters. Has anyone seen this and can it be fixed?

2 replies

by phil_perkins_1

What are you using to email? CDO, CDONTS, WinSock/SMTP? If you're using CDO or CDONTS, you can set the BodyFormat to HTML and use a click here syntax. This will only work for mail clients that can parse HTML.

However, if it'sjust plain text, you may be restricted by the email client. If this is the case, you could shorten your link by sending this person to a page with a shorter cross-reference identifier in the query string and find the longer tracking number information in a table stored at your site through script.

by tom.com

Here's some of the code from our program:
Public Sub Send_Email()
' Leaving sProfile equal to Null will force the user to select which Mapi profile to use. To keep from being
' prompted, you must supply a valid user profile. sProfile = "MS Exchange Settings"
' Create the Session Object.
Set objSession = CreateObject("mapi.session")
' Log on using the session object. Specify a valid profile name if you want to avoid the logon dialog box.
objSession.Logon profilename:=sProfile
' Add a new message object to the OutBox.
Set objMessage = objSession.Outbox.Messages.Add
' ' Set the properties of the message object.
'set the text message in the email
objMessage.Text = strMessage
objMessage.Subject = strSubject
' Add a recipient object to the objMessage.Recipients collection.
Set objRecipient = objMessage.Recipients.Add
' Set the properties of the recipient object.
objRecipient.Name = strRecipient
objRecipient.Type = mapiTo
objRecipient.Resolve
' Send the message. Setting showDialog to False sends the message without displaying the message
' or requiring user intervention. A setting of True displays the message and the user must choose to Send from within the message dialog.
objMessage.Send showdialog:=False
' MsgBox "Message sent successfully!" Log off using the session object.
objSession.Logoff
End Sub
When we test the code and send message to our internal e-mail accounts, the URL is OK and works properly. If we send it to another domain, it's hit or miss as to whether the entire link is recognized or not. If there's a better way, I'm game.

This discussion is closed to new replies.