I sent a mail to my gmail account e.g abc@gmail.com from my yahoo account abc@yahoo.com. No i want to reply from abc@gmail.com back to abc@yaoo.com
I fetched the original mail from my gmail account abc@gmail.com using its UID so i can build a reply mail. It was successfully fetched with the FROM property set to abc@yahoo.com and the TO property set to abc@gmail.com as expected. code is a below:
IMail original = Getuidmessage(getimapset.imap, getimapset.port,
getimapset.username, getimapset.password,
theuidtofetch, nassl);
ReplyBuilder replyBuilder = original.Reply();
// You can specify your own, custom, body and subject templates:
replyBuilder.HtmlReplyTemplate = @"
<html>
<head>
<title>[Subject]</title>
</head>
<body>
[Html]
<br /><br />
On [Original.Date] [Original.Sender.Name] wrote:
<blockquote>
[QuoteHtml]
</blockquote>
</body>
</html>";
replyBuilder.SubjectReplyTemplate = "Re: [Original.Subject]";
replyBuilder.Html = additional_message + message1.ToString();
MailBuilder thebuilder = replyBuilder.Reply(
new MailBox(original.Sender.Address, original.Sender.Name));
thebuilder.ReplyTo.Add(new MailBox(getimapset.username, sender_fullname));
thebuilder.ReturnReceiptTo.Add(
new MailBox(getimapset.username, sender_fullname));
thebuilder.RequestReadReceipt();
IMail reply = thebuilder.Create();
1st Problem:
IMail reply = thebuilder.Create();
While inspecting the reply IMail variable, the FROM property is set to abc@yahoo.com and the TO property is set to abc@yahoo.com. My expected FROM property should be abc@gmail.com while the TO property to abc@yahoo.com. When the mail finally delivers, it displays as a mail from ME to ME which is hilariously wrong for me.
2nd problem
when i use to ReplyToAll() method to create my builder as below
MailBuilder thebuilder = replyBuilder.ReplyToAll(
new MailBox(original.Sender.Address, original.Sender.Name));
It sets my FROM property to abc@yahoo.com and the TO property to abc@gmail.com.I expect the reverse.
I dont know if this is a bug but its not working for
Note: I am using the SMTP of abc@gmail.com as the reply person.