How to use CDONTS in VB application to send mail without using Microsoft Outlook

How to use CDONTS in VB application to send mail without using Microsoft Outlook

Post by Suhas Gandhewa » Mon, 02 Sep 2002 00:16:18



Hi all,
 
 
 

How to use CDONTS in VB application to send mail without using Microsoft Outlook

Post by Suhas Gandhewa » Mon, 02 Sep 2002 00:16:20


Hi all,

 
 
 

1. How to send a mail through VB application using CDONTS without using Outlook

Hi all, there is the requirement for me to write a mailing
application in VB to send a mail using Collaborative data
object for NT server(CDONTS) without using outlook file.
The requirement is urgent. Can anbody please help me? I
have written the code but it is not working. The code is
as such  : -                                            
Sub main()
Dim objSession As CDONTS.Session   ' or Dim objSession As
MAPI.Session
Dim objMessage As CDONTS.Messages
Dim objMessage1 As CDONTS.Message ' or Dim objMessage As
Message
Dim objOneRecip As CDONTS.Recipients ' or Dim objOneRecip
As Recipient
Dim objOneRecip1 As CDONTS.Recipient
Dim objOutbox As CDONTS.Folder

    On Error GoTo error_olemsg

' create a session then log on, supplying username and
password
Set objSession = CreateObject("CDONTS.Session")
' change the parameters to valid values for your
configuration
objSession.LogonSMTP "Suhas

Set objOutbox = objSession.GetDefaultFolder
(CdoDefaultFolderOutbox)
Set objMessage = objOutbox.Messages
Set objMessage1 = objOutbox.Messages.Add

With objMessage1
         .Text = "This is my text."
         .Subject = "This is my subject."
         .Recipients.Add

                                                    'recipi
ent name here.
End With

objMessage1.Send
Set objSentItems = objSession.GetDefaultFolder(2)
objSession.Logoff
Exit Sub

error_olemsg:
MsgBox "Error " & Str(Err) & ": " & Error$(Err)
Resume Next
End Sub

2. System Attendent MailBox.

3. How to send a mail through VB using CDONTS without using Outlook

4. Can Exchange 5.0 work through Proxy?

5. How to send mail from ASP without using CDONTS

6. Archiving emails @ server

7. Sending on-off address from vb(script) without using MAPI

8. Information Store & Event Service wouldn't start

9. Sending Mail with Outlook using VB

10. Using CDONTS with Exchange 5.0 to sent automatic mail from ASPs