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

what is the command to send email

Posted on 2002-05-23
8
124 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
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 100

Expert Comment

by:mlmcc
ID: 7031152
learning
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA saving file message display 5 72
Access query that references subform 5 47
TT Auto Dashboard 13 95
Added a column screws up code 5 63
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

860 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