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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Visual Basic 4 sending email

Status
Not open for further replies.

SSK

Programmer
Sep 27, 2000
15
0
0
NZ
I have written an application in VB4 and want to send a database (zipped) via email as an attachment. What controls are needed (MAPI? etc) under win98. An some tips on code etc.

thanks

SSK [sig][/sig]
 
I have a sendmail dll written in VB that may be of use to you, drop me an email and I'll pass it onto you.

Mike_Lacey@Cargill.Com [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Making mistakes, so you don't have to. &lt;grin&gt;[/sig]
 
Using a DLL seems a little unnecessary. Why not just:
[tt]
Public Declare Function ShellExecute Lib &quot;shell32.dll&quot; Alias &quot;ShellExecuteA&quot; (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

Private Sub Command1_Click()
ShellExecute Form1.hWnd, vbNullString, &quot;mailto:michael.j.lacey@ntlworld.com?subject=Email from VB&quot;, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
[/tt]
Sometimes, simple is better. [sig]<a href=mailto:CraigL@bc-corp.com>CraigL@bc-corp.com</a><br>[/sig]
 
Quite right Index (Craig) -- and that's what I do normally.

I didn't reccomend it in this case because:

1) SSK asked to be able to attach a file (and I don't know how to do that from the command line)

2) ShellExecute depends on a mail client, that can do the things you want, being installed on the client machine. The sendmail.dll doesn't.....

This should be a FAQ really -- laying out the pro's and con's of the various methods and recommending when to use which one. [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Making mistakes, so you don't have to. &lt;grin&gt;[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top