I have implemented a server that sends emails via .Net SmtpClient. the mail sending code is as follows:
private static MailMessage SendMail(string to, string subject, string body) { MailMessage mailToSend = new MailMessage(); mailToSend.Body = body; mailToSend.Subject = subject; mailToSend.IsBodyHtml = true; mailToSend.To.Add(to); try { mailClient.Send(mailToSend); } catch (Exception ex) {
and in Web.config I set the mail credentials, something like this:
<configuration> <system.net> <mailSettings> <smtp from=" autoemail@mailserver.org "> <network host="smtp.mailserver.org" password="pswdpswd" port="25" userName="autoemail" clientDomain="the-domain" enableSsl="true" /> </smtp> </mailSettings> </system.net> </configuration>
The letters were sent successfully, and everything works fine, but when I log in to the email user on the exchange server (for example, through the Outlook Web-App), I donβt see the mail sent through SmtpClient (via code) in the folder of the sent goods.
How can I save a copy of sent emails in these folders? Thanks!
yossico
source share