I have made a report with textbox which when it is clicked, Outlook is opened and I can send a mail (parameters like subject and body are set). How can I make sending a mail automatic? Without clicking 'Send' button on opened Outlook?
You could send the mail from the server instead of from the client.
Therefore you can configure Database Mail in the SQL Server. Then you can send mails using stored procedures. You can trigger that procedure using a dataset of a subreport.
But what is your use case? Sharing reports? I think there a nicer solutions for that.
Related
I am currently using SMTP in a .net application to send files automatically when the user prompts the system
We have recipients setup to receive certian SSRS files, some clients want all and some clients only want one report. As such, the user just hits send and we send each client a single email with their requirements.
The issue is that since we have added this flexibility the clients have lost who is receiving the file.
Is there anyway to list all the receipients of an email in the to section or am I going to have to move all the recipients to the body of the email?
By default smtp server can be configed in Sitecore web.config. However is it possible to hijack the whole email sending part to use a different method instead of a smtp server? Is there some kind of pipeline?
For example, I want to use another web service to send all emails, or I want to save all of them into a database instead of actually sending them?
Also a different question would be, does content delivery instance need to send emails by default? I would assume all out-of-box email sending are from content authoring instance right?
And from my understanding, there's only workflows in Sitecore need to send emails and it can be customized by changing the email action. (Assume no Email Campaign Modules, no Webform for Markets module and etc.)
Any insight would be great help, thanks!
--------------Update---------------------29/09/2015--------------
I have got my answers, thanks everyone.
Basically I shouldn't need to working about the smtp server on CDS instances, and all email sending can be controlled by pipelines on CAS instances.
However when I checked the source code, there's only one place "Reminder" which uses the smtp server to send emails directly. So if this function is important to you, you should consider update this function.
Yes absolutely.
At runtime when you are defining the SMTPClient you can set the properties for the server by the following code
SmtpClient client=new SmtpClient("Host");
client.Credentials=new NetworkCredential("username", "password");
MailMessage mailMessage = new MailMessage();
mailMessage.from="sender#gmail.com";
mailMessage.To.Add("recipient#gmail.com");
mailMessage.body="body";
mailMessage.subject="subject";
client.Send(mailMessage);
What you can do, instead of having the values hardcoded in the code you can retrieve the values from Sitecore Items and use those, this will allow greater control for Content Editors and even use different SMTP Server in different parts of functionality.
Item emailItem = Sitecore.Context.Database.GetItem("Id of Item");
string from = emailItem["From"];
string to = emailItem["To"];
string server = emailItem["Mail server"];
string subject = emailItem["Subject"];
string message = emailItem["Message"];
There is a SendEmail pipeline apart of Sitecore's EXM aka ECM which you can override if you take the EXM route. It has two processors FillEmail and SendEmail which you can utilise or remove and add your own processor for actually sending the message.
It is possible to save the emails to a database, or rather the content, instead of sending them. This can be achieved by custom code in Sitecore or Webforms for Marketers which has Save Actions for Sending Emails or Saving to a Database and its really simple to configure.
As you said there is no need to send emails on every occasion its more about determining what you are trying to achieve and if Sending Emails, Saving to Database etc is more relevant. The great thing about Sitecore is you can create Items programmatically and store the information there, save you worrying about creating database tables, managing ConnectionStrings, setting up EntityFramework etc.
Here is a simple blog on creating Sitecore Items Programmatically.
Sitecore Workflow sending Emails is optional and can be removed by deleting the Send Email CommandAction Item from beneath the WorkflowState Item and then publish.
The easiest way to intercept all emails is to configure Sitecore to send all emails to the locally hosted SMTP server (127.0.0.1) and then grab them from there using your custom code.
There is a lot of free SMTP servers, just make sure you test them with high volume of emails before moving to production.
Our system sends a "Daily Update" email via Reporting Services to all users each morning. If people are on a computer there's no issue. But, for users on the go, some mobile device email clients can't render the email. However, they can all render pdf files.
So... the quick fix was to create two subscriptions for each user; one with the message in the body and one with the message in an attached pdf. This creates an annoying amount of friction. I'd love to send a single email with the message in the body a duplicate pdf version attached.
Is there a simple solution?
FYI, we're managing this through Reporting Services Subscriptions.
By default, no: you can't have both formats in one email
The report "render format" determines whether inline or attached if you check "Include Report". So setting to "PDF" will generate an attachment. However, if you check "Include Link" for PDF rendering then folk can click and go to the report served by the Web site.
Otherwise, you'd have to write some small app that calls the ReportServer service and gets both report formats and combine into one email. Or write your own custom delivery extension
I think it is better to use Database Mail. You can manage it to send e-mail or SMS or even both of them to your subscribtion list.
I'm not sure that you can send a single email with the message in the body a duplicate pdf version attached.
If I understood it correctly, you want to send an email with attachment in pdf and this pdf will have same text/data as that in email body, right?
If that is the case then don't you think "Include Report" with "Render Format" in PDF will give you desired result?
I have created a custom Outlook form in 2007 and I have some receipeints that need to visualize it but do not use Outlook as their email program. Is it possible to make changes to the Form to ensure that they are able to view the form as an email?
I don't think so.
Is it possible to detect the email client in an html message? Specifically outlook 2007
Update
My users have access to an online system that really has nothing to do with email, but in this system they can all communicate with themselves.
My app - takes messages from this system, and then sends it via an email instead.
Now I need a reply to function. Obviously its not a normal email address so...
I want a way to intercept this message, and send it via another channel.
I could write the outlook plug to check EVERY SINGLE out going email address, but this surely can't be the way we're expected to work with email.
It would be much easier to have a button in the email itself which can call an outlook function (custom) and then pass control to this function.
Uodate
Thanks guys for your answer, but there is a little more complexity. The online system contains fields, these fields need to be completed by the user before sending the reply. So I need some kind of form (yes with working check boxes, etc in there). This should all be in the email message.
Essentially what you'll need to do is set up an automated process that monitors a particular email address, and set that address as the reply-to in your outgoing email. When a message comes in, you can do whatever analysis you need to (examining the from, subject, etc.) and process the content however you see fit.
"Detect" using what? Javascript does not work in email. CSS stylesheets don't either - so no CSS hacks.
Have you tried to change the Reply-To header in the email to the direction that you want?
You have an example in C# & VB in: http://www.systemwebmail.com/faq/2.7.aspx