Solved

what is the command to send email

Posted on 2002-05-23
8
121 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
Comment Utility
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
Comment Utility
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
Comment Utility
learning
0
 

Author Comment

by:furious581
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 17

Accepted Solution

by:
inthedark earned 25 total points
Comment Utility
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
Comment Utility
Inthedark is right!
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

772 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

15 Experts available now in Live!

Get 1:1 Help Now