Click to See Complete Forum and Search --> : sending email
aspet
Dec 4th, 2001, 02:18 AM
I need an Ocx for sending email that I can use in my project in VB6.0
davegr
Dec 4th, 2001, 07:57 AM
This is not an ocx, but i use it currently. I assume you have mail running on your pc, so it should work.
Private Sub SendMes()
Dim Cell_Number As String
Cell_Number = TxtCellNum
If TxtCellNum <> "" Then
MASess.UserName = "" ! put your user name here
MASess.SignOn
SignedOn = True
MpMess.SessionID = MASess.SessionID
MpMess.MsgIndex = -1
MpMess.RecipDisplayName = "name of recipient here can be anything"
! you may or may not need SMTP bit below
MpMess.RecipAddress = "SMTP:" & "email address here"
! Message is string containing message to go
MpMess.MsgNoteText = Message
'Send the message without dialog box
MpMess.Send False
MASess.SignOff
Message = ""
'Number = ""
End If
End Sub
aspet
Dec 4th, 2001, 12:31 PM
but you I dont know what are those objects that you have used in your subroutine I mean like Mcasse
but anyway thanks for your help
ied
Dec 4th, 2001, 10:12 PM
If you're using outlook you can use this if not tell me what you're using and I can post an appropriate response...
Public Sub SendMail(Subject As String, Recipient As _
String, Message As String)
Dim objOutlook As Object
Dim objClient As Object
Set objOutlook = CreateObject("Outlook.application")
Set objClient = objOutlook.createitem(0)
With objClient
.Subject = Subject
.To = Recipient
.body = Message
.Send
End With
Set objOutlook = Nothing
Set objClient = Nothing
exit sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.