我正在制作一个电子邮件客户端 wpf 应用程序。它工作正常,只是我不知道如何向它添加图像。我还想在 PC 上将我撰写的电子邮件另存为 pdf 或 docx 文件。
我搜索了很多,但找不到合适的答案。请帮忙
我的电子邮件方法是这样的:
private void sendEmailB_Click(object sender, RoutedEventArgs e)
{ SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.Credentials = new NetworkCredential(gmailID.Text, gmailPass.Password);
client.EnableSsl = true;
MailMessage msg = new MailMessage();
msg.From = new MailAddress(gmailID.Text);
msg.To.Add(new MailAddress(sendEmailID.Text));
msg.Subject = "handmail message";
msg.Body = contentMain.Text;
try
{
client.Send(msg);
MessageBox.Show("Message sent successfully");
}
catch (Exception ex)
{
MessageBox.Show("Unable to send mail due to some reasons" + ex.Message);
}
}