[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Sending HTML link via sendmail

Posted on 2000-03-02
7
Medium Priority
?
227 Views
Last Modified: 2012-06-27
Working on a project that brings up a form dependent on the criteria that the user inputs.  Am capturing this data in order to send email to another user that will point in to this same form.  The hyperlink will change for each user depending on what path they need to follow.
I need to find a way to send a hyperlink thru the sendmail funcion.
So far it looks like all I can send is text, but I need the link to be 'clickable' so the user can go directly from their mail to the page.  I know how to do it in an ASP page, but we need this functionality thru SQL for other aspects of the project.  Any ideas?
0
Comment
Question by:cglaser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 1

Expert Comment

by:vujos
ID: 2578741
Hi,

Use option

MyMail.BodyFormat = 0 (for HTML)
MyMail.BodyFormat = 1 (for TEXT)



For example :

Set myMail = CreateObject("CDONTS.NewMail")  
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>" HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & "HTML = HTML & ""content=""text/html; charset=iso-8859-1"">"""
HTML = HTML & "<title>Sample Mail</title>" HTML = HTML & "</head>"
HTML = HTML & "<body>"
HTML = HTML & "This is a sample message being sent using HTML. <BR></body>"
HTML = HTML & "</html>"  myMail.From = "Example@Microsoft.com"
myMail.To = "Someone@Company.com" myMail.Subject = "Sample Message"
myMail.BodyFormat = 0 myMail.MailFormat = 0 myMail.Body = HTML myMail.Send
Set myMail = Nothing


Some of the sites to visit (one of them is source of the above code)

http://www.activeserverpages.ru/iishelp/iis/htm/asp/amsm0qzj.htm 
 
http://www.15seconds.com/Issue/980325.htm 
 
http://www.zdjournals.com/asp/9906/asp9961.htm 
 
http://www.aspzone.com/articles/john/HowToSendEmail/HowToSendEmail.asp 
 
http://www.aspalliance.com/wsk/aboutemail.asp 


Hope this helps.
0
 
LVL 1

Accepted Solution

by:
vujos earned 400 total points
ID: 2578745
Hi,

Above source code is not to nice so :

Hi,

Use option

MyMail.BodyFormat = 0 (for HTML)
MyMail.BodyFormat = 1 (for TEXT)



For example :

Set myMail = CreateObject("CDONTS.NewMail")  
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>" HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & "HTML = HTML & ""content=""text/html; charset=iso-8859-1"">"""
HTML = HTML & "<title>Sample Mail</title>" HTML = HTML & "</head>"
HTML = HTML & "<body>"
HTML = HTML & "This is a sample message being sent using HTML. <BR></body>"
HTML = HTML & "</html>"  

myMail.From = "Example@Microsoft.com"
myMail.To = "Someone@Company.com" myMail.Subject = "Sample Message"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
Set myMail = Nothing

Hope this helps.
0
 
LVL 2

Expert Comment

by:kubeerja
ID: 2581006
EXEC xp_sendmail 'kubeerja', 'http://www.yahoo.com'
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:cglaser
ID: 2583380
That's exactly what I needed!

Christy
0
 
LVL 2

Expert Comment

by:kubeerja
ID: 2583439
Christy

I don't know what is the relation between your question and the answer and SQL server.

can you explain!!!!!
0
 

Author Comment

by:cglaser
ID: 2588879
The answer that was given can be inputed into the trigger that will fire when the database is updated.  I had a trigger that would fire a text email to the designated user, but I needed one that would format the message in HTML so that the links that were sent would be 'clickable'.  The above answer gives me this option.
Does that help?? :)

Christy
0
 
LVL 2

Expert Comment

by:kubeerja
ID: 2589602
I know that this code can send an HTML mail may be in VB or in ASP, but I wonder how you can run it from a trigger. As far as I know I don't think you can use CreateObject in MS SQL procedure or trigger, unless you are working with a different SQL server. You can call com objects from a stored proc but not in this way.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question