Results 1 to 4 of 4

Thread: sending email

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Posts
    11

    sending email

    I need an Ocx for sending email that I can use in my project in VB6.0

  2. #2
    New Member
    Join Date
    Nov 2001
    Location
    South Africa
    Posts
    3
    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
    Rgds
    Dave Greening

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Posts
    11

    Unhappy email sending

    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

  4. #4
    New Member
    Join Date
    Dec 2001
    Location
    London, UK
    Posts
    2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width