2 replies
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.
Trending Web Development posts
Sort by Trending