I'm using SubVersion and TRAC on a C# project I am working on, and I have my TRAC system setup with a email address that can be used to create tickets. In my program I've added a simple "FeedBack" button in my program which sends an email to this address. To open the email I'm just "starting" a mailto link as shown below.
System.Reflection.Assembly assem = System.Reflection.Assembly.GetExecutingAssembly();
string ver = assem.GetName().Version.ToString();
System.Diagnostics.Process.Start("mailto:foo#bar.com?subject=<Provide a title for your feedback here>&body=< Describe the problem you are having or enhancement you would like to suggest here. Please be as descriptive as you can, and if possible list out the actions that will replicate the problem >%0D%0A%0D%0A%0D%0AVersion: "+ver);
The problem I'm running into is if the user is using Outlook and their copy of Outlook is setup to HTML the ticket that gets created ends up having a bunch of HTML code that I have to clean up. Is there some way to notify whatever mail client is handling it to send the email as text rather then HTML?
There's nothing you can do (besides education) on the client - there's nothing in mailto to control a client side program. And, frankly, with the proliferation of web-based email - I think mailto is showing it's age.
Outlook should send a mime/multipart message, with both plain text and HTML parts. I'd guess you could extend or patch Trac to only grab the text/plain portion.
Otherwise, just create a form in your app to capture the email info. Again, if someone is using Hotmail or GMail - mailto is not likely to work anyway (or will open up their unconfigured Outlook Express, where they will dutifully type up an email and press Send. Only it won't go anywhere, because no SMTP servers are configured - so it will languish in the Outbox for years. Not that they will notice though...).
Related
I managed to export multiple charts as pdf and download it on client side. Is there a way to email that pdf to email that user types. I was not able to find anything. I am using .net framework on server side.
Is it possible to send pdf to server using ajax and to send it to email from server that way?
Assuming that you've got the PDF content and the email address to send it to from the client side, you can send email via .NET from your back-end server. This used to be done via the built-in SmtpClient class but Microsoft now recommends people to use other options like MailKit instead.
You're also going to need an email server to connect to which will handle the delivery of those emails. This could be Gmail if you already have an account or an alternative like SendGrid
As far as getting the PDF content of the chart, Highcharts appears to be taking the SVG content of the chart and using svg2pdf to produce the PDF when not using an export server.
Since there appears to be no (documented) way of exporting to anything other than a file, you're likely going to need to mimic this process yourself by taking the SVG content via chart.getSVG() and then using svg2pdf to get your PDF content to send to your server.
Highcharts is a client html2print generator and like jsPDF or other client based solutions the PDF generation is per user selection of PDF printout options. (The client has control over PDF so no need for them to email it to self or others, unless they have to.)
Per link above
However, for situations where you may be generating a report for a client who has just seen the screen (and you don't need to change the chart in anyway) - why would you want to render the chart server side? when the client has already done the work.
To build server side automatically using a browser the server needs generally to process it, just like a user, with say chrome --headless options for html2pdf (and chrome can normally do that in one line, but with limited user layout options).
At that point you could have a PDF for attachment by any conventional mime application/pdf means (e.g. convert to base64.txt).
However due to the more dynamic drawing of svg (rather than a static insert) I could not run an Out.PDF --headless just by CLI, so it would need a driven solution such as selenium/puppeteer. THUS you may need to follow the suggestions in the lee-m above answer to build and modify the svg output.
for me I was able to run printEdge.vbs (with my current landscape defaults)
DIM shell
SET shell = WScript.CreateObject("WScript.Shell")
Shell.Run "cmd /c start msedge.exe file:///C:/Users/WDAGUtilityAccount/Documents/highchart.htm"
WScript.Sleep(4000)
Shell.SendKeys "^p"
WScript.Sleep(3000)
Shell.SendKeys "{enter}"
WScript.Sleep(1000)
Shell.SendKeys "{enter}"
WScript.Sleep(1000)
Shell.SendKeys "y"
WScript.Sleep(1000)
Shell.SendKeys "{esc}"
WScript.Sleep(1000)
Shell.SendKeys "%{f4}"
I have an Outlook addin that handles attachments by sending them to our server and then embedding a link into the body of the email containing the URL to the uploaded attachment.
This works but it is not 100% satisfactory because the URLs can get broken depending in the email client and the sender will not see their attachments listed at the top of there email where they are use to seeing them.
Ideally what I would like to do is exactly what is being done for OneDrive.
Currently if I add an attachment and provide a URL as the source it will download the file and send it as a normal attachment which is the exact opposite of what I want. I have noticed that if it fails to download the file it will then just send the URL as an attachment which is what I want. But sending broken URLs is not very useful.
Using
Outlook.MailItem.Attachments.Add("https://myserver.com/somefile", 7, 1, "MyAttachment")
If I set the attachment type to '7' which is what is used for OneDrive attachments I can get it to send the URL but it will first complain about not being able to set some access rights and if the sender clicks OK to continue anyway the attachment will appear to the sender and the receiver as residing on OneDrive which it is not, but clicking the URL will download the file from my server as I want.
My question is: Is it possible to send a none OneDrive URL as an attachment?
(I expect the answer is no, but I am hoping some Outlook guru out there may know some trick to do this.)
My other alternative it to wrap my URLs in an small html file that is then sent as a normal attachment and when opened will provide the link to the actual file.
We have written an Outlook add-in in C#, that appends a custom header to outgoing messages.
This add-in has to use a library called Redemption to bypass Outlook's security to modify the headers, and this is all working great.
Our problem lies when sending outgoing mail through an exchange server. We use the additional header as such:
Add a References header with an email address that includes an ID for tracking with our system.
This is a standard email header that all mail clients should pass on when replying to messages. So replying to a message will automatically keep the new message tracked.
All of this works just fine if you send an email from an IMAP account setup in Outlook such as GMail.
Problem is, if you send mail via an Exchange account, the Exchange server overwrites the References header and uses it's own proprietary headers: Thread-Index and Thread-Topic. Email standards suggest to use References and In-Reply-To headers. See this link on this issue.
Does anyone know a way around this? Some algorithm to gain us the following:
Add a header (of any name or kind) to emails that includes a 10-digit ID and 3 letter prefix
Replying to this email from all (or most) mail clients preserves the custom header
I think the following algorithm is going to solve our issue:
Our Outlook add-in will set the References and an arbitrary X- header
Our mail filter will look for References, if found use it (if outgoing mail server was Exchange, it will not be present)
If our mail filter finds the arbitrary X- header and a Thread-Index, it will store the data found in the X- header.
Later if the email is replied-to several times, the mail filter will use the Thread-Index to look up the past info to keep the email tracked.
For those wanting to know internals of the Thread-Index header, it is a Base64 encoded string. The first 22 bytes are the original unique portion and each reply adds an additional 5 bytes on to it. We only use the first 22 bytes to identify the email.
I'm trying to send an html email to a gmail account, but for some reason, Google is stripping away the html from my email. The Html is preserved when I send to other accounts (non-gmail accounts) so I know that my html is correct.
Here's how I'm going about it:
I have an aspx page, that I use as an email template.
I grab the html from the aspx page from within a web service (done in C#)
Dynamically fill in the non-static content through c# code within the web service.
Send that as the email body.
Does anyone happen to know why gmail is removing the html?
Thanks in advance.
You need to be sure to set the IsBodyHtml property to true on your MailMessage:
var message = new MailMessage();
message.IsBodyHtml = true;
// Fill and send message here
Check out the MSDN reference for more info:
System.Net.Mail.MailMessage Members
The Html is preserved when I send to other accounts (non-gmail accounts) so I know that my html is correct.
It's not a programming issue. If it were, as you've observed, this would happen to all clients.
The issue is this: Most modern email clients allow users to choose to disallow html messages, or always view them as plain text. That could be what is happening here. You have to code to expect this, because you can't control user's preferences. If they have this enabled, and you send it as html only, it will look ugly to them.
However, for a solution to your issue, you should always be sending your mail as a Multi-Part Mime message to allow all clients to get a nice readable version.
I want to send someone a HTML Mail via my application (c#). This Mail contains should contain a clickable html link that refers to a local application. f.e. :
click
It already works to send the mail but the link does not appear as a link. I also tried the "file:/// ... " thing but it does not work in combination with a param.
Does someone know another solution ?
Due to Security this does not work.