As the title says, using C# code-behind of a ASP.Net project, I would like to open the user's default mail client with a message's body already filled with certain information.
I was able to directly send a message with information in it:
private static bool EnvoieCourriel(string adrCourriel, string corps, string objet, string envoyeur, Attachment atache)
{
SmtpClient smtp = new SmtpClient();
MailMessage msg = new MailMessage
{
From = new MailAddress(envoyeur),
Subject = objet,
Body = corps,
IsBodyHtml = true
};
if (atache != null)
msg.Attachments.Add(atache);
try
{
msg.To.Add(adrCourriel);
smtp.Send(msg);
}
catch
{
return false;
}
return true;
}
I was also able to open the user's default email client :
string email = op.CourrielOperateur1;
ClientScript.RegisterStartupScript(this.GetType(), "mailto", "parent.location='mailto:" + email + "'", true);
But now... I would like to open the client just like the second example but the body must be already filled with a default text...
Any ideas would be appreciated.