ashokbioinfo
02-04-2012, 06:14 AM
Hi all,
Iam trying to send mail through outlook but not getting the output. Here is the code below.
when I am able to send the mail and check "send items" folder, it should not be there (mail should be auto deleted i.e. send item folder should be blank)
Sub mail()
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "abc@yahoo.com (abc@yahoo.com)"
'.Cc = "ifneed@copy.com (ifneed@copy.com)"
.Subject = "Hello World (one more time)..."
.Body = "This is the body of message"
.HTMLBody = "HTML version of message"
'.Attachments.Add ("c:\myFileToSend.txt")
'.Send 'Letīs go!
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
Iam trying to send mail through outlook but not getting the output. Here is the code below.
when I am able to send the mail and check "send items" folder, it should not be there (mail should be auto deleted i.e. send item folder should be blank)
Sub mail()
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "abc@yahoo.com (abc@yahoo.com)"
'.Cc = "ifneed@copy.com (ifneed@copy.com)"
.Subject = "Hello World (one more time)..."
.Body = "This is the body of message"
.HTMLBody = "HTML version of message"
'.Attachments.Add ("c:\myFileToSend.txt")
'.Send 'Letīs go!
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub