Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to save copy of sending mail in "Send" Mail box. I am using this code to send mail. The mail was send successfully.
Dim ChkDateMail As New DataAccessLayer
            Dim email As New System.Net.Mail.MailMessage
            Dim GmailSmptp As New SmtpClient
            GmailSmptp.Host = "smtp.gmail.com"
            GmailSmptp.EnableSsl = true
            GmailSmptp.Credentials = New Net.NetworkCredential(SenderEmailAddress, SenderEmailPassword)
            email.To.Add(txtEmailTo.Text.Trim)
            email.From = New System.Net.Mail.MailAddress(SenderEmailAddress)
            email.Subject = txtEmailSubject.Text.Trim
            email.IsBodyHtml = True
            email.Body = txtEmailBody.Text.Trim
            GmailSmptp.Send(email)
Posted
Updated 20-Jun-11 6:07am
v2
Comments
Simon_Whale 20-Jun-11 12:09pm    
Is that you want to save a copy of the sent mail into the sent items folder of the account?
raviprajapat 20-Jun-11 12:17pm    
yes
[no name] 21-Jun-11 0:14am    
Who knows?

In a nutshell you can't put sent emails into a online account's sent mail folder, you would have to use an email client like outlook and this will put it into the outlooks sent items

Send an email with Outlook[^]
 
Share this answer
 
Comments
Espen Harlinn 25-Jun-11 13:48pm    
Right - my 5, that's usually not much fun from asp.net, so let us hope he is developing a Windows Forms client.
Add the email address to MailMessage.Bcc[^] that will receive a copy of the email.
 
Share this answer
 
Comments
raviprajapat 20-Jun-11 12:19pm    
this link has error:-"The specified CGI application encountered an error and the server terminated the process."
Kim Togo 20-Jun-11 12:21pm    
Strange. Working fine here.
But it says: Gets the address collection that contains the blind carbon copy (BCC) recipients for this e-mail message.

MailAddress bcc = new MailAddress("manager1@contoso.com");
message.Bcc.Add(bcc);
raviprajapat 20-Jun-11 12:32pm    
Thats not answer of my quetion.. my quetion is send mail information is save in Send item folder of the account. i do't want to add bcc in my mail.
you need to set the DeliveryMethod property to Network.

Smtp Delivery Method[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900