Sending Mail from Excel with VBA

R

RFraley

I have an Excel (2003) VBA application that sends e-mail through our
Exchange server. Everything works fine, but I am looking to address an issue
that is somewhat undesirable with the procedure. The e-mail is sent by
clicking on a command buttom from a userform. As I said; the e-mail is sent
(by the VBA application) correctly. The problem is that the process of
sending the e-mail switches control to Outlook. The user then has to switch
back to the Excel application after the e-mail is sent. This is minor, but
it detracts from the overall professionalism with regard to the appearence
and function of the application. Is it possible to prevent the e-mail code
from switching to Outlook? I'd really like this to be transparent to the end
user. If anyone has a suggestion for how I can improve this situation, I'd
really appreciate some help. Since I don't have much experience with Outlook
and VBA, a code sample would be very helpful.

Thanks in advance
Ralph Fraley
 
F

Franck

Haha same problem as me, i find out what is it, it is the new security
from outlook 2003, you can't get rid of it except with a vbscript file
(sendemail.vbs), i learn a way to solve it it's to use the adminpack
(orktools.exe) available on the office 2003 cd's / server 2003 (not
sure) / on the office website. Ive tried it and it didn't work for me,
we use exchange too and this thing make a security group and full of
stuff, it was saving but on opening it wasnt working.
it you want you can shell a .vbs with special script here the code to
send email without popup.

Set objMessage2 = CreateObject("CDO.Message")
objMessage2.Subject = "title of email"
objMessage2.From = "(e-mail address removed)"
objMessage2.To = "(e-mail address removed)" 'need to be valid adress at
the smtp
objMessage2.TextBody = "message"
'**********
Folowing appear weird on google groups but after the .item theres a
space and the parentesis follow there no enter
***************
objMessage2.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'dont
change this
objMessage2.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp.domain.com"
objMessage2.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' the port dah
objMessage2.Configuration.Fields.Update
objMessage2.Send
 
N

netnews.comcast.net

Thanks; I was able to get this to work from home with my ISP e-mail
provider, but this does not work when I am at work on my company's network.
I need a solution that will work with Exchange and Outlook. I am not
concerned about the security popup; I have a small application called
Express Clickyes that takes care of the security popup. What I want is to
send the e-mail without Outlook becoming the foreground (or active)
application. When the e-mail is sent, the user has to switch back to the
Excel application because Outlook remain active after sending the e-mail.

Thanks in advance for any help provided.
Ralph
 
N

netnews.comcast.net

Thanks; I was able to get this to work from home with my ISP e-mail
provider, but this does not work when I am at work on my company's network.
I need a solution that will work with Exchange and Outlook. I am not
concerned about the security popup; I have a small application called
Express Clickyes that takes care of the security popup. What I want is to
send the e-mail without Outlook becoming the foreground (or active)
application. When the e-mail is sent, the user has to switch back to the
Excel application because Outlook remain active after sending the e-mail.

Thanks in advance for any help provided.
Ralph
 
F

Franck

This current code work with exchange 2003, i had myself used clickyes
the trial version before. But i prefered no popup (well user prefered
that) so i used this one, to work properly be sure the smtp server
adress you use is ok, Recentrly i was using my domain smtp and before i
was using the isp smtp. Send from outside like using hotmail account to
company email and check the header of the email smtp should be there. I
once used smtp.company.local but now for unknown reason i have to use
smtp.isp.com(.ca in my case)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top