In my program I need to send email. Now email is sending successfully. But now I need to add signature to my email. This application is used by 5 users. So I need to add 5 signatures. My signature is in .htm format. So how can I send my emails with this signature.
This is my email sending program.
using (MailMessage mm = new MailMessage("xxxxxxxx", "xxxxxxxxx"))
{
mm.Subject = "Test mail";
mm.Body = File.ReadAllText("sign.htm");
mm.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "xxxxxxxxx";
NetworkCredential credential = new NetworkCredential();
credential.UserName = "xxxxxxxxxxx";
credential.Password = "xxxxxxxxx";
smtp.UseDefaultCredentials = true;
smtp.Credentials = credential;
smtp.Port = 587;
smtp.EnableSsl = false;
smtp.Send(mm);
}
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
"alertMessage",
"alert('message send successfully');", true);
I have added the sign.htm file in C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\sign.html'. Its working fine. But it will not display any images. And this is usefull for one client. If more than one person is using my system how can I do this. Is there any another way to attach this signature?
sign.htm is my signature.

Raja TRank #685 · 3.5K reputationPosted Mar 5, 2016, 9:23 PM EST
using System; using System.Collections.Generic; using System.Text; using EASendMail; //add EASendMail namespace namespace mysendemail { class Program { static void Main(string[] args) { SmtpMail oMail = new SmtpMail("TryIt"); SmtpClient oSmtp = new SmtpClient(); // Set sender email address, please change it to yours oMail.From = "[email protected]"; // Set recipient email address, please change it to yours oMail.To = "[email protected]"; // Set email subject oMail.Subject = "test html email with attachment"; // Your SMTP server address SmtpServer oServer = new SmtpServer("smtp.emailarchitect.net"); // User and password for ESMTP authentication, if your server doesn't require // User authentication, please remove the following codes. oServer.User = "[email protected]"; oServer.Password = "testpassword"; // If your SMTP server requires SSL connection, please add this line // oServer.ConnectType = SmtpConnectType.ConnectSSLAuto; try { // Import html body and also import linked image as embedded images. oMail.ImportHtml( "test importhtml", "c:\\my picture", //test.gif is in c:\\my picture ImportHtmlBodyOptions.ImportLocalPictures | ImportHtmlBodyOptions.ImportCss ); Console.WriteLine("start to send email with embedded image..."); oSmtp.SendMail(oServer, oMail); Console.WriteLine("email was sent successfully!"); } catch (Exception ep) { Console.WriteLine("failed to send email with the following error:"); Console.WriteLine(ep.Message); } } } }Rajeesh MenothRank #118 · 18.4K reputationPosted Mar 5, 2016, 9:32 PM EST
Sivajihero Hero99 reputationPosted Mar 6, 2016, 9:20 PM EST
Raja TRank #685 · 3.5K reputationPosted Mar 6, 2016, 9:26 PM EST