Resolved People how i can send email structure?

Joined
Aug 25, 2020
Messages
12
Programming Experience
Beginner
Hello guys, how are you?

So, i have need your help, my program need open one structure email (outlook) from one button. How i do?
I´m using c#.
 
Can you elaborate what you mean by "email structure"? Perhaps English is not your first language, and what you actually meant was "email template"?

Do you really need to send out email through Outlook (because you actually want to talk directly to an Exchange server)? Or is it okay to send out direct SMTP mail? Or if you really must use Exchange, can you use the Exchange Object Model (as opposed to the Outlook Object Model)?

In general C# and the .NET Framework doesn't have built in mail merge capabilities where you can fill in data into an "email template" and send it. You'll have to code this yourself or find a library that does this, and then hookup an event handler for your button to execute this code.
 
I need this for when the user click in one button, the button open a new email message, with one structure, which i need make it on code.

Structure example:

Hi,

Your ticket as been fixed, your ticket is closed

_________________________________________________________________________________________________________-

Hi,

Your ticket it's a solved being.

_____________________________________________________________________________________________________________

Hi,

Your ticket it´s closed
 
Yes, that is called an email template. You do realize that Outlook supports email templates out of the box (albeit, with newer versions of Outlook it's now 3-4 button clicks to launch a template as opposed to the older version where it was just 2 clicks.)

.
 
You can also use the Outlook Object Model.


What would be cool is if you create an Outlook Add-in and then use the Outlook Object Model to load the appropriate template.


Why am I insisting that you go down the templates route instead of just using the Outlook Object Model to fill in the message body? By using templates you give yourself (and your users) more freedom to create better formatted email messages. It is possible to do the same with with the Outlook Object Model but it will be hard coded and you'll be expending a lot of hours cycling over updating the code, installing the add in code into the GAC/registry, installing the add in, trying the button, and then uninstalling the add in, and starting the cycle over again. (Sometimes you can skip some of the installation steps if the change is purely a binary code code change.)
 
There is no guarantee that will start Outlook. That will start whatever the user has defined to be their default mail client.
 
That's because it has to be one big long mailto: URL string. The variant of Process.Start() that you are using expects the first strint to be an executable path, and the second string to be parameters to be used by the executable. That won't work since Outlook has no idea how to parse that second string because it was never meant to be launched that way; and it is only through blind luck that you even have Outlook launching with a mailto: . I would have expected an error with that 2 string variant.
 
As said you compose the mailto as a single string value.
 
Back
Top Bottom