Results 1 to 5 of 5

Thread: How can I make program able to send email?

  1. #1

    Thread Starter
    Hyperactive Member solar115's Avatar
    Join Date
    Apr 2002
    Location
    Thailand
    Posts
    268

    How can I make program able to send email?

    If I want to make my program able to send simple email in html format, What way I can do it? (step by step or some Example Code)
    ^solaris^

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: How can I make program able to send email?

    Originally posted by solar115
    If I want to make my program able to send simple email in html format, What way I can do it? (step by step or some Example Code)
    this would get you started .
    VB Code:
    1. ' Create DevMailer Object
    2.  Set Mailer = CreateObject("Geocel.Mailer")
    3.  
    4. ' Add first SMTP server
    5.  Mailer.AddServer "mail",25
    6.    
    7. ' Set Sender Information
    8.  Mailer.FromAddress = "[email protected]"
    9.  Mailer.FromName = "First Last"
    10.  
    11. ' Add a recipient to the message
    12.  Mailer.AddRecipient "[email protected]","You"
    13.  
    14. ' Set the Subject and Body
    15.  Mailer.Subject = "Welcome to DevMailer"
    16.  
    17.  Mailer.Body =  "Test Message Body Line 1" & VbCrLf & _
    18.         "Test Message Body Line 2" & VbCrLf
    19.  
    20. ' Send Email - Perform Error Checking
    21.  bSuccess = Mailer.Send()
    22.  
    23.  If bSuccess = False Then
    24.     If Mailer.Queued = False Then
    25.       MsgBox( "Could not send message..queueing failed!" )
    26.     Else
    27.       MsgBox( "Could not send message..queued instead!" )
    28.     End If
    29.     Else
    30.       MsgBox( "Message Sent Successfully!" )
    31.     End If

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    another simple way
    VB Code:
    1. 'Declarations
    2. 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
    3. Private Const SW_SHOW = 5
    4.  
    5. 'in a form
    6. ShellExecute hwnd, "open", "mailto:[email protected]", vbNullString, vbNullString, SW_SHOW

  4. #4
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308
    Hello pirate,

    What will your two codes use, default mail client, outlook or what ?? Can you give some explanation ??

  5. #5
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577
    Originally posted by usamaalam
    Hello pirate,

    What will your two codes use, default mail client, outlook or what ?? Can you give some explanation ??

    That will just show the default email program that the user is using.
    It wont actually send a email, it will just popup a compose new message dialog

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