How can I avoid seeing this dialogue when sending email from VB6?
I'm using the code below from phinds in the FAQ to send email from a VB program, but I know it's going to cause a lot of concern with the users, and probably result in the user not sending the email, especially with the word "VIRUS" in the dialogue. See attached screenshot for dialogue of concern.
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "you@email.com
.Cc = "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
Re: How can I avoid seeing this dialogue when sending email from VB6?
there is two things (that I know of) that you can do.
1. Uninstall that version of outlook and use access 2000 instead.
2. Don't use outlook (or MAPI). Use SMTP, vbSendMail, CDO, or some other method instead.
Re: How can I avoid seeing this dialogue when sending email from VB6?
Originally Posted by Zeb
I don't think that option exists in Outlook though, only Outlook Express
If that may be the case then he may look for the other methods. I thought there are 5 ways to send email via VB as seen in the FAQ, he may check it out. But my favorite is talking with the SMTP protocol with winsock.
Re: How can I avoid seeing this dialogue when sending email from VB6?
Originally Posted by Thread1
If that may be the case then he may look for the other methods. I thought there are 5 ways to send email via VB as seen in the FAQ, he may check it out. But my favorite is talking with the SMTP protocol with winsock.
Yeah, but reading through all the emails, everything was shot down except this method
Re: How can I avoid seeing this dialogue when sending email from VB6?
Originally Posted by Zeb
there is two things (that I know of) that you can do.
1. Uninstall that version of outlook and use access 2000 instead.
2. Don't use outlook (or MAPI). Use SMTP, vbSendMail, CDO, or some other method instead.
Re: How can I avoid seeing this dialogue when sending email from VB6?
Originally Posted by cappy2112
Cant do that. This is on a corporate computer. Everyone must use Outlook.
So you probably have your own mail server, which means that the other options I listed would be the best. Im 99% certain you can't remove that dialog through code, a setting or registry hack or something, so you can either write something to click the box automatically (tough work), or just re-write that mail component to use a non-outlook/mapi method.
vbSendMail is probably the easiest (and is linked to in the other post I gave you)
Re: How can I avoid seeing this dialogue when sending email from VB6?
sorry - i should elaborate...
the other options i listed just take the middle man (outlook) out of the equation. they speak direct with a mail server (i.e. microsoft exchange) to create and send emails. it gives you heaps more power and flexibility and allows you to bypass outlook completely for automating emails.
the only issue is that it may mean that some configuration will be required on your mail server so that it doesn't think you are trying to send spam.
but if you want to be able to preview emails in outlook or something like that before you send them (i.e. they aren't purely automated) then you probably can't use those options (at least, it is easier to just have the user click "yes" when the outlook window pops up)
After following the instructions on my system I no longer get bothered by the annoying prompt telling me that I'm sending an email (or other activity in outlook)
Take a little while to follow the instructions carefully, and it should work.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.