Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 Sending email

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
CA
Hello,

I am creating a new project that will require sending an email with an attachment. Looking through past projects, we have one project that uses MAPISession and MAPIMessages while the other uses vbSendMail.clsSendMail. To my knowledge, both methods have worked equally well in the past.

I'm wondering which method is more recommended or more efficient or if another method is preferred.

Thanks.



If at first you don't succeed, then sky diving wasn't meant for you!
 
No, with CDO you don't need a email client. Test it with Gmail. You'll see that an email is created in Gmail on the internet.
 
@Jack, I don't have an gmail account and I'm sure that the user won't either. I'm using my work account. If I change the port to 465, it takes long then errors:
"The transport failed to connect to the server."

If at first you don't succeed, then sky diving wasn't meant for you!
 
Well, Gmail is free, so anyone can create an account for testing.
 
This has been a very lively thread. Thank you to everyone who responsed.

@Jack, yes that's true but not completely practical.

After a few more adjustments, I did get it with a combination of everyone's input. The program sent the email with an attachment and it was received through my work email.

Thank you again for everyone's help.

If at first you don't succeed, then sky diving wasn't meant for you!
 
This is also an idea:
Create a general Gmail account and hardcode it in the program.
Even if you have dozens of users they all send invisible via that gmail account even if the recipient is seeing
Big Bob <myuserid@demo.net> as sender.

Of course this is nog good practise, but it will work. Until the 7.7 Gb of Gmail is filled up.
 
This is also an idea:
Create a general Gmail account and hardcode it in the program.
Even if you have dozens of users they all send invisible via that gmail account even if the recipient is seeing
Big Bob <myuserid@demo.net> as sender.

Of course this is nog good practise, but it will work. Until the 7.7 Gb of Gmail is filled up.

Bye
Jack
 
I'm not sure it is obvious, but when you create a CDO.Message object its .Configuration is pre-loaded with default settings.

If it is being used in a server with the IIS SMTP Service installed it takes the settings from there, or if running on a client system it attempts to load account and remote server settings from the user's MAPI client's default account, etc. More detail on this can be found at MSDN.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top