Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated email through Exchange 5.5

Status
Not open for further replies.

Torp23

Programmer
Jun 13, 2002
32
US
I am an MCP and need some advice/direction. I am trying to add an email service to my web site where members will receive email confirmation of their registration and periodic bulletins, etc... I am a VB 6 programmer and will be doing this in COM objects and I have Exchange 5.5 w/SP2 running on NT4 SP6a. The only piece that I am missing is accessing and sending email in code through Exchange. I downloaded the Cdoasp.exe file from msdn and ran it on my server (which is also my IIS 4.0 server), but I am having problems with that. Is there any advice anyone has on learning more about using the cdo or maybe some other method to send email through code (VB) to send email? Thanks in advance! :)
 
here is the code i used in one of my aplication:
I read every 3 minutes the unread messages of a mailbox and them i mask them as unread

Dim con As ADODB.Connection
Dim rst As ADODB.Recordset
Dim objSess, objInbox, objMsgColl, objMsgFilter As Object
Dim objMess As Message

Private Sub Form_Load()
Me.Caption = "incoming Alerts utility"
Set objSess = CreateObject("MAPI.Session")
'logon to session
objSess.Logon profileName:="****", _
profilePassword:="*****", _
showDialog:=True, _
ProfileInfo:="EXcangeName" & vbLf & "Mailbox"

Set objInbox = objSess.Inbox
Set objMsgColl = objInbox.Messages ' get Inbox's messages collection

End Sub


Private Sub new_alerts()

Dim str As String
Dim str_line As String
Dim k As Long

Dim b As String

'filters
Set objMsgFilter = objMsgColl.Filter
objMsgFilter.TimeLast = DateValue("02/17/09")
objMsgFilter.Unread = True

For Each objMess In objMsgColl

HERE put your code .I used string manipulatiion and trasfered all my data in SQL.Read the subject and put maybe some If statements. To send mail the code is similar and is in the Foums FAQ

'mask As read
objMess.Unread = False
objMess.Update

update_rst


Next


End Sub


Private Sub Timer1_Timer()

Static Minutes As Long

Me.Enabled = False
Minutes = (Minutes + 1) Mod 3
If Minutes = 0 Then
new_alerts
End If
Me.Enabled = True

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top