Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Placing a web link in an email body

Author  Topic 

JLK
Starting Member

5 Posts

Posted - 2007-11-28 : 16:06:55
I'm generating emails using sp_send_dbmail. Everything works perfectly except for one thing. In the body of the email I need to show a link to a web page (eg http://myweb/login.aspx).

The problem is that the received email shows the "link" as plain text, ie it is not a clickable link. I've tried adding char(13) (and char(10) and both) after the link text but that doesn't help.

Is there a way to make the link text a real link when received by Outlook? (All recipients will be using Outlook if that helps).

Thanks,

John

anonymous1
Posting Yak Master

185 Posts

Posted - 2007-11-28 : 16:11:31
are you using @body_format = 'HTML'?
Go to Top of Page

JLK
Starting Member

5 Posts

Posted - 2007-11-28 : 16:16:19
Yes I am. The code for the email itself is:

OPEN _EmailCursor
FETCH NEXT FROM _EmailCursor INTO @JPOEmailAddress
WHILE @@FETCH_STATUS = 0
BEGIN
--Send Email
SET @EmailBody =
'There was placement activity regarding youth in your caseload.
Please click the following link, log in to JJIS Intake Web and review the
Placement Activity Report.' + CHAR(10) + CHAR(13) + CHAR(10) + CHAR(13) +

'jjisweb1/dotnetsystems/JJISBusinessProcess/Login.aspx' + CHAR(10) + CHAR(13)

EXEC msdb.dbo.sp_send_dbmail @profile_name='JPO_Notification',
@recipients = 'john.kilgo@djj.state.fl.us', --@JPOEmailAddess,
@Subject = 'Placement Activity Notification',
@Body = @EmailBody,
@Body_Format = 'HTML' ;
FETCH NEXT FROM _EmailCursor INTO @JPOEmailAddress
END

CLOSE _EmailCursor
DEALLOCATE _EmailCursor
Go to Top of Page

JLK
Starting Member

5 Posts

Posted - 2007-11-28 : 16:26:53
Forgot to say that all the char(10)s and 13s are just stuff I've been trying in order to fix the problem.
Go to Top of Page

anonymous1
Posting Yak Master

185 Posts

Posted - 2007-11-28 : 16:59:44
try this...

SET @EmailBody =
'There was placement activity regarding youth in your caseload.
Please click the following link, log in to JJIS Intake Web and review the
Placement Activity Report.' + CHAR(10) + CHAR(13) + CHAR(10) + CHAR(13) +

'<a href="./jjisweb1/dotnetsystems/JJISBusinessProcess/Login.aspx"> Login </A>' + CHAR(10) + CHAR(13)
Go to Top of Page

JLK
Starting Member

5 Posts

Posted - 2007-11-29 : 13:41:34
The "Login" appears as a link as desired but it does not work. A click on the link doesn't take you anywhere. If I hover over the link the status bar reads "outbind://" plus about a 60 character GUID looking string. Pressing CTRL when clicking on the link does change the behaviour either. As an aside I don't understand the "./jjisweb1". Is "." an escape character for a "/"?
Go to Top of Page

JLK
Starting Member

5 Posts

Posted - 2007-11-29 : 16:09:40
Issue resolved.
Go to Top of Page
   

- Advertisement -