Sending mail from window server to outlook using VB6

RAJwin777!

New Member
Joined
May 9, 2011
Messages
1
Dim objOutlook As Object
'Dim objOutlookMsg As Object
'Set objOutlook = CreateObject("Outlook.Application")
'Set objOutlookMsg = objOutlook.CreateItem(0)
'With objOutlookMsg
' .To = shiva@rediffmail.com
'' .Cc = abc@yahoo.com
' '.Cc = bcd@gmail.com
' .Subject = "MSG Server Health Check Report"
' .Body = "Report Attached"
' .HTMLBody = "Sample Report Attached"
' .Attachments.Add ("C:\HealthCheck-Test\HC-Result.txt")
' .Send 'Let´s go!
'End With
'
'
'
'Set objOutlookMsg = Nothing
'Set objOutlook = Nothing
Set objFSO = Nothing

Not able to sent the mail using the above code. we are getting security alert with yes or no option... Even after clicking "yes" not able to send the mail.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Everything's commented out. Did you do that before you posted the code or is this the exact actual code you're running?

When you say, 'Even after clicking "yes" not able to send the mail', do you get an error message? If you replace .Send with .Display, does it create and display the message? Does the message ever end up in your Drafts or Sent Items?<!-- / message -->
 
Upvote 0
Are you actually doing this in Excel?

I believe there are methods to handle the security alert VBA from there.

However if it is VB6 code then I don't if those would apply.
 
Upvote 0

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top