Solved

Done a Million Times

Posted on 2000-03-24
2
285 Views
Last Modified: 2010-05-02
I am trying to send an email from a VB form, I have tried to do it a million times but most of the code that i have found is very complicated. I need something that is simple and easy to understand. The only fields that am using are TO,Subject and message.I prefer using either outlook objects or CDO whichever works.
0
Comment
Question by:hello_200
2 Comments
 

Accepted Solution

by:
sljbaqga earned 29 total points
ID: 2656200
you can use MAPI Controls comming with VB6
add component MAPI Contols.
then use MAPI Session and MAPI Message controls to send what ever the messages you wants to send.


there is a good sample project comes with MSDN.
its located in <MSDN Path>\98VS\1033\SAMPLES\VB98\misc\Vbmail folder

ex. in my machine it's
C:\Program Files\Microsoft Visual Studio\MSDN98\98VS\1033\SAMPLES\VB98\misc\Vbmail

have a look
regards
Prasad
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2656328
Add Microsoft Outlook to your references:

  Dim x As Outlook.MailItem
  Dim a As Outlook.Application
   
  Set a = New Outlook.Application 'using an open session or loggin on using the default profile
  Set x = a.CreateItem(olMailItem)
  x.To = "Hengel@tecsys.lu"
  x.Subject = "Mail using outlook"
  x.Body = "This is the text to send"
send"
  x.Send
  a.Quit
  Set x = Nothing
  Set a = Nothing

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now