Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Send emails from a VB application

Posted on 2003-10-30
9
148 Views
Last Modified: 2010-05-03
I use CDONTS to send emails from my web app. I have SMTP services installed on my Web Server.
But let me ask you guys - Can I send emails from a standalone VB app without having any email client on ?
0
Comment
Question by:jitganguly
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 9654487
Sure, have a look at the free vbSendMail component that is using SMTP : http://www.freevbcode.com/ShowCode.Asp?ID=109
0
 
LVL 5

Expert Comment

by:fantasy1001
ID: 9654989
Try this:
'Only for win2000
    Set objMail = CreateObject("CDONTS.Newmail")
    objMail.subject = " iThread Default Package "
   
        FilePath1 = "C:\iThread\iMail\iMailDefault\" & g_EventID & "_" & g_EventName & "\picture.jpg"
        FilePath2 = "C:\iThread\iMail\iMailDefault\" & g_EventID & "_" & g_EventName & "\audio.wav"
        FilePath3 = "C:\iThread\iMail\iMailDefault\" & g_EventID & "_" & g_EventName & "\default.bmp"
           
    objMail.To = "me@myplace.com"
    objMail.bcc = ""
    objMail.From = "you@yourplace.com"
    objMail.subject = "Default Multimedia Test"
    objMail.body = "This is an auto email sent by a remote iThread system. This mail may have 1, 2, or 3 attached files."
    objMail.Importance = 2
    objMail.BodyFormat = 0
    objMail.mailformat = 0
    objMail.attachfile (FilePath1)          
    objMail.attachfile (FilePath2)      
    objMail.attachfile (FilePath3)        

   objMail.send
   Set objMail = Nothing  

OR

http://www.freevbcode.com/ShowCode.Asp?ID=109
http://www.freevbcode.com/code/vbSendMail.zip

Regards,
~ fantasy ~
0
 
LVL 20

Author Comment

by:jitganguly
ID: 9655110
Guys,
1. I do not want to use 3rd party dlls
2. I am running on NT

Don't yu have something like CDONTs concept of VBScript ? I just need to send a mail to some guys after running a VB app. VB app runs on a workstation and I cannot keep outlook client on all the time (Its a Blloberg machine)
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 5

Accepted Solution

by:
fantasy1001 earned 50 total points
ID: 9655264
Can you use MAPI:
A good and details example is this: http://www.devarticles.com/art/1/78/2

                                                                    Regards
                                                                 ~ Fantasy ~
0
 
LVL 1

Expert Comment

by:vkaushik
ID: 9655565
You can use MAPi controls from your vb app to send mails. There is a MAPi sample also available with Visual Studio or you can have a look at Microsoft site or use SMTP.ocx which is freely available on the net.
0
 

Expert Comment

by:pg_india_job
ID: 9656397
But don't we need to configure SMTP server..

I mean if i want to just send it thru a desktop(without IIS) can i do that..
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 9656755
>1. I do not want to use 3rd party dlls

Since you have complete source code, you can include it into your actual project!
0
 
LVL 1

Expert Comment

by:vkaushik
ID: 9656784
Yes you can do that with smtp.ocx. You need to provide the mail server ip address and user login/pwd details. Its very esy to use the ocx.
0
 
LVL 20

Author Comment

by:jitganguly
ID: 9658201
Fantasy,
I looked at the article and ran it. It works fine when my outlook client is on. Otherwise it asks for a MS exchange settings.

Question - Can I have that running without running Outlook client or any email client ?
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question