Hi
I’m using the System.Web.Mail class to send emails from my .net application. Here’s the code for my send button.
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim Counter As Integer
If txtSubject.Text = "" Then
MsgBox("Enter the email subject", MsgBoxStyle.Information,
"Send Email")
Exit Sub
End If
obj.SmtpServer = "xxx.xxx.x.xxx"
Mailmsg.To = MyVarTo 'to
Mailmsg.From = MyVarFrom 'from
Mailmsg.BodyFormat = MailFormat.Html
Mailmsg.Subject = txtSubject.Text
For Counter = 0 To lstAttachment.Items.Count - 1
Attachment = New MailAttachment(lstAttachment.Items(Counter))
Mailmsg.Attachments.Add(Attachment)
Next
Mailmsg.Body = txtMessage.Text
obj.Send(Mailmsg)
End Sub
Although this works fine, I want to be able to store the email in the sent items folder of the default user of whichever PC the mail is sent from on Exchange. I’ve never seen this done before using this method. Does anyone know if it’s possible and how I could achieve this?
Thanks
Andrew
I’m using the System.Web.Mail class to send emails from my .net application. Here’s the code for my send button.
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim Counter As Integer
If txtSubject.Text = "" Then
MsgBox("Enter the email subject", MsgBoxStyle.Information,
"Send Email")
Exit Sub
End If
obj.SmtpServer = "xxx.xxx.x.xxx"
Mailmsg.To = MyVarTo 'to
Mailmsg.From = MyVarFrom 'from
Mailmsg.BodyFormat = MailFormat.Html
Mailmsg.Subject = txtSubject.Text
For Counter = 0 To lstAttachment.Items.Count - 1
Attachment = New MailAttachment(lstAttachment.Items(Counter))
Mailmsg.Attachments.Add(Attachment)
Next
Mailmsg.Body = txtMessage.Text
obj.Send(Mailmsg)
End Sub
Although this works fine, I want to be able to store the email in the sent items folder of the default user of whichever PC the mail is sent from on Exchange. I’ve never seen this done before using this method. Does anyone know if it’s possible and how I could achieve this?
Thanks
Andrew