?
Solved

what is the command to send email

Posted on 2002-05-23
8
Medium Priority
?
129 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses

752 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