Solved

Email from VB

Posted on 2000-05-11
3
161 Views
Last Modified: 2010-05-02
Hi,

Anybody has code for sending an email from vb?

Desperate, please!!!

Regards,
Rajesh in Christ.
0
Comment
Question by:rgodavarthi
3 Comments
 
LVL 1

Accepted Solution

by:
sdbanks earned 50 total points
ID: 2801804
I did a search earlier for the same thing.  Here is the answer I liked best.



http://www.experts-exchange.com/bin/BuyPAQ?qid=10176294
0
 
LVL 2

Expert Comment

by:Crin
ID: 2802564
Wow sdbanks, not a good habbit to post the answer to the question... Especially if this answer will decrease points of one who asked...

rgodavarthi

Be careful, clicking provided link will decrease your points.

Provided example in fact use SMTP directly and is right, of course.

Now one another way - the way if you want to use installed mailer to initiate e-mail:

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long

then use

ShellExecute 0, "open", "mailto:crin@mail.com", "", "", 1

or any e-mail address you like (or variable) instead the "mailto:crin@mail.com" :))

Sincerely yours,

Crin
0
 

Expert Comment

by:buem
ID: 2808006
If you want to send mail through mail box in your computer , You must be use MAPI of microsoft in Windows system which you can see example in your sample directory of VB in your computer.
buem,
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 While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

948 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

23 Experts available now in Live!

Get 1:1 Help Now