R
R V Prasad
Guest
Hi,
I have created a basic form in vb.net with one button. When we click on button an email will trigger to particular email ID mentioned in the code. And I want to include the current sender in email Cc while sending an email. I want to get the current sender email address. I'm using below code but it isn't working. Can anyone advise here.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oApp As New Outlook.Application()
Dim oMsg As Outlook.MailItem = DirectCast(oApp.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem)
Dim SenderEMailID = oMsg.SenderEmailAddress
MessageBox.Show(SenderEMailID)
oMsg.To = "abc@xyz.com"
oMsg.CC = SenderEMailID
oMsg.Subject = "Test Mail"
oMsg.Send()
End Sub
Continue reading...
I have created a basic form in vb.net with one button. When we click on button an email will trigger to particular email ID mentioned in the code. And I want to include the current sender in email Cc while sending an email. I want to get the current sender email address. I'm using below code but it isn't working. Can anyone advise here.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oApp As New Outlook.Application()
Dim oMsg As Outlook.MailItem = DirectCast(oApp.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem)
Dim SenderEMailID = oMsg.SenderEmailAddress
MessageBox.Show(SenderEMailID)
oMsg.To = "abc@xyz.com"
oMsg.CC = SenderEMailID
oMsg.Subject = "Test Mail"
oMsg.Send()
End Sub
Continue reading...