I have job that saves email receiver, sender, email subject and email body to database which by then sends
by another job.
by another job.
I need to attach emoji along with subject text.
I need to attach pizza emoji with my subject how do i do it? (code for emoji is U+1F355 in https://emojipedia.org/runner/ )

Amit GuptaRank #190 · 12.8K reputationPosted Sep 6, 2019, 10:04 AM EDT
Istudent RanaRank #4,270 · 354 reputationPosted Sep 6, 2019, 10:42 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Sep 6, 2019, 11:08 AM EDT
Istudent RanaRank #4,270 · 354 reputationPosted Sep 6, 2019, 11:25 AM EDT
byte[] utf8Bytes = Encoding.UTF8.GetBytes(pizzaEmoji);
{
msg.From = new MailAddress("[email protected]");
msg.To.Add("[email protected]");
msg.Subject = "Test";
msg.Body = "Test";
msg.IsBodyHtml = true;
msg.BodyEncoding = Encoding.UTF8;
msg.Subject = "test message " + Encoding.UTF8.GetString(utf8Bytes);
msg.SubjectEncoding = Encoding.UTF8;
using (SmtpClient smtp = new SmtpClient(host))
{
smtp.Send(msg);
}
}