Custom Code in SSRS to send email.
Hi, I have a vb.net code which opens an outlook message with required body .I want to open this outlook message through ssrs.So i copied the same code in Custom Code in SSRS Report >Report Properties > Code and added the references. Still its not working. My vb.net code is Public Sub Sendmail() Dim oApp As Outlook.Application = New Outlook.Application() Dim oMail As Outlook.MailItem = oApp.CreateItem(Outlook.OlItemType.olMailItem) oMail.Subject = " Hello" oMail.HTMLBody = "<a href ='http://www.yahoo.com'>Link to page</a>" oMail.Display() End Sub I completely new to vb.net. Thanks
February 14th, 2011 1:37pm

I do not think that will work...You can schedule reports to email but open OUTLOOK I think inpossible.Please explain what you are trying to achive?Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
Free Windows Admin Tool Kit Click here and download it now
February 14th, 2011 1:41pm

I have a link on the report.On clicking the link, an outlook message open ups with the URL .Since there are many parameters, the URL is lengthy so i want to put the URL as " Link ". and on clicking this "Link", it should open up the URL. Initially i had created the URL in SSRS using javascript, but i could not set this feature using that. So i was trying to see if i can do using vb.net writting a custom code. for eg:- < www.yahoo.com> Link <> Is there any options availble to do this ?
February 14th, 2011 3:03pm

Hi, If you just want to open an Outlook message with specified subject and body, you can use a "Jump to URL" action with "mailto" URL, which can achieve your purpose and avoid complicated custom code. For example, drag a textbox to your report, right click it, in popup menu select "Text Box Properties", in Text Box Properties window, switch to "Action" tab, and then check "Go to URL" radio button, in "Select URL" textbox, input below URL: mailto:Recipient@address.com?subject=Hello&body=<a href ='http://www.yahoo.com'>Link to page</a> Now you can preview the report. When you click the textbox, it will open an Outlook message as your want. For more information about "mailto" syntax, please refer to: http://msdn.microsoft.com/en-us/library/aa767737(v=vs.85).aspx If there is anything unclear, please feel free to ask. Thanks, Albert Ye
Free Windows Admin Tool Kit Click here and download it now
February 17th, 2011 8:54am

Actually what i want is to open the URL of the server where the report is being deployed and pass parameters from the report to the URL, so that a user can send link of the report to soem one else. For eg:- In the report i have hyperlink feild " Email Report", So when some one click on this , an outlook message pops up with To & subject and body will contain the URL of that report ( which is being opened).
February 24th, 2011 4:40pm

it works...thxGive me baby one more time
Free Windows Admin Tool Kit Click here and download it now
July 18th, 2011 1:28am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics