Solved

what is the command to send email

Posted on 2002-05-23
8
127 Views
Last Modified: 2010-05-02
hi
I have a spare parts form and when spare parts is out of stock a new form comes in which it should contact the suppliers by email how can I do that Please let me know
Exactly what I need is that when I press the button I want all the information to be sent by email through outlook express

Thanks
0
Comment
Question by:furious581
[X]
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
8 Comments
 
LVL 17

Expert Comment

by:inthedark
ID: 7030690
vbSendMail, easy to use less bugs than MAPI, won't send viruses, you'll love it!

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

Best of luck....
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7031047
If Outlook express is your default mail:
' paste this code in notepad, save it as frmDefMail and add to your project:


VERSION 5.00
Begin VB.Form frmDefMail
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Open default Client Mail"
   ClientHeight    =   3675
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3675
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command1
      Caption         =   "&Cancel"
      Height          =   375
      Index           =   1
      Left            =   3345
      TabIndex        =   11
      Top             =   3225
      Width           =   1215
   End
   Begin VB.CommandButton Command1
      Caption         =   "&Open Default"
      Height          =   375
      Index           =   0
      Left            =   2010
      TabIndex        =   10
      Top             =   3225
      Width           =   1215
   End
   Begin VB.TextBox Text1
      Height          =   1575
      Index           =   4
      Left            =   1095
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   9
      Top             =   1575
      Width           =   3450
   End
   Begin VB.TextBox Text1
      Height          =   300
      Index           =   3
      Left            =   1095
      TabIndex        =   7
      Top             =   1200
      Width           =   3450
   End
   Begin VB.TextBox Text1
      Height          =   300
      Index           =   2
      Left            =   1095
      TabIndex        =   5
      Top             =   825
      Width           =   3450
   End
   Begin VB.TextBox Text1
      Height          =   300
      Index           =   1
      Left            =   1095
      TabIndex        =   3
      Top             =   435
      Width           =   3450
   End
   Begin VB.TextBox Text1
      Height          =   300
      Index           =   0
      Left            =   1095
      TabIndex        =   1
      Top             =   60
      Width           =   3450
   End
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Message:"
      Height          =   195
      Index           =   4
      Left            =   120
      TabIndex        =   8
      Top             =   1620
      Width           =   690
   End
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Subject:"
      Height          =   195
      Index           =   3
      Left            =   120
      TabIndex        =   6
      Top             =   1245
      Width           =   585
   End
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "BCC:"
      Height          =   195
      Index           =   2
      Left            =   120
      TabIndex        =   4
      Top             =   870
      Width           =   360
   End
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "CC:"
      Height          =   195
      Index           =   1
      Left            =   120
      TabIndex        =   2
      Top             =   480
      Width           =   255
   End
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "To:"
      Height          =   195
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   105
      Width           =   240
   End
End
Attribute VB_Name = "frmDefMail"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private 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

Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0
    ShellExecute 0, vbNullString, _
                 "mailto:" & Text1(0).Text & _
                 "?subject=" & Text1(3).Text & _
                 "&body=" & Text1(4).Text & _
                 "&CC=" & Text1(1).Text & _
                 "&BCC=" & Text1(2).Text, _
                 0&, 0&, 1

Case 1
    Unload Me
End Select
End Sub

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 7031152
learning
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:furious581
ID: 7033869
HI  Richie_Simonetti

THe complier gave me an error on the below acually it couldn't be defined

Private 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

0
 
LVL 17

Accepted Solution

by:
inthedark earned 25 total points
ID: 7034080
Its the way things from ee are pasted, you can type long statements in VB but EE puts CR+LF in long lines.

Try this instead:

Private 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


0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7034525
Inthedark is right!
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7818467
Hi furious581,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: inthedark and Richie_Simonetti

furious581, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7910130
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

points for Richie_Simonetti at:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20505888.html
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…

726 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