We help IT Professionals succeed at work.

Sending Email

feesu
feesu asked
on
414 Views
Last Modified: 2007-12-19
Experts,
I found the below code that sends emails via VB. I don't want to get those popups saying that there is someone trying to send an email on your behalf, and the other security warnings. what shall i do???

    Dim objSession As Object
    Dim objMessage As Object
    Dim objRecipient As Object
    Dim objAttachment As Object
    Set objSession = CreateObject("mapi.session")
    objSession.Logon profileName:="MS Exchange Settings"
    Set objMessage = objSession.Outbox.Messages.Add
    Set objAttachment = objMessage.Attachments.Add
    objAttachment.Position = 1
    objMessage.Subject = "File transfer"
    objMessage.Text = Date
    objMessage.Update
    Set objRecipient = objMessage.Recipients.Add
    objRecipient.Name = "feesu@xyz.com"
    objRecipient.Type = mapiTo
    objRecipient.Resolve
    objMessage.Send ShowDialog:=False
    objSession.Logoff
Comment
Watch Question

Commented:
Open outlook express
Goto Tools- > Options
Goto security tab
Click on "warn Me when other applications try to send mails as me

Author

Commented:
sparab,
How can i apply this by code? This code is supposed to run on a number of clients, and i'm not supposed to manually do that on all stations! Thanks.

Author

Commented:
and by the way, i'm using MS Outlook 2003 and not express!
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
Hi feesu!

Try this:

http://www.codeguru.com/columns/DotNet/article.php/c5467/
and
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q286431

Using the CDO (Collaboration Data Ojects) component from Microsoft worked great for me.

HtH

regards,

Cierech

Author

Commented:
Hi all,
i have tried everything. I still get the outlook warning message!
CERTIFIED EXPERT

Commented:
Did you try the vbSendMail-Component too?

Author

Commented:
The vbSendMail-Component gives a runtime error; "Cant create object"

Author

Commented:
Hi herreruud!
I'm sorry, I didn't copy the dll into the system32. Now it's working. Thank you.
CERTIFIED EXPERT

Commented:
Cool. No irritating messages?

Author

Commented:
No messages :) but the only thing is that i have to install that dll on all clients. but it's the best solution i've faced.
Thanks everyone for your help.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.