-2

I'm sending email through asp.net code using godaddy mail server. Mail is sent successfully but not stored in sent item folder. I am using below code :

SmtpClient client = new SmtpClient();
client.Host = "smtpout.secureserver.net";
client.Port = 25;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("software@XXXXXXXX.com", "XXXXXXX");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = false;
client.Send(message);
message = null; // free up resources
// client.Send(message);
msg = "Successful";
James Z
  • 12,209
  • 10
  • 24
  • 44
  • This is normal behaviour for SMTP. If you want to create items in a folder on the server, you will need an IMAP client. – Bradley Smith Mar 05 '20 at 01:48

1 Answers1

1

That's how SMTP works. It's purely a protocol for dropping a mail off at a mail server, either by your originating client or an interim server dropping it off at another upstream server. SMTP servers work in chains; your client drops off at godaddy, today's might drop off at an upstream server, upstream server drops off at destination (or another upstream; many servers might handle it on the way).

If SMTP stored mails in a sent mail folder, every server involved in the delivery chain would have a copy of every mail it ever transited - hard disks would be full in minutes!

Storing in a Sent Items folder is typically a function of a different service like IMAP. After a heavyweight mail client like Outlook sends a mail using SMTP it stores a copy of what was sent using an IMAP connection (same mail server, probably- totally different protocol). If you want the same functionality you have to build an IMAP client into your program too

If this isn't easy to understand, a real world analogy:

You open Word, write a letter, print it, post it (=SMTP), and turn your computer off. The document is not in My Documents folder (=sent items folder). If you want it there they you have to click Save in Word, save into your My Documents folder (=IMAP storage in sent items folder)

Caius Jard
  • 72,509
  • 5
  • 49
  • 80