Sending Alert mails from CCPulse

Hi,

I created a threshold and the following associated action to send an alert by mail.

the problem I have is that it uses my Outlook by default and my email address :

as soon as the threshold is reached, two popup windows appear telling me to allow Outlook to send an email for the CCPulse application.

If I am not in front of my computer and do not click Yes twice, the mail won’t be sent.

Is there anyway to get read of these messages ?

Is it possible to use the “smtp_host”, “smtp_port” and “smtp_from” to send an alert by mail ? (to have no popup window to click on)

Here is the code I use for the moment :


'Body of email message

Dim msgBody

msgBody=“Alert from CCPulse !!!”

'Call our function with profile, recipient, message, and subject

SendMail “”,“”,msgBody,“GENESYS PRODUCTION : Alert !!!”

Sub SendMail(profile, recipient,msg,subject)

Dim objSession, objAddrEntry, oInbox, colMessages, oMessage, colRecipients, oRecipient

Set objSession = CreateObject(“MAPI.Session”)

objSession.Logon profile,“”,True,False,0, False

Set objAddrEntry = objSession.CurrentUser

Set oInbox = objSession.Inbox

Set colMessages = oInbox.Messages

Set oMessage = colMessages.Add()

Set colRecipients = oMessage.Recipients

recipient = “[email removed]”

If recipient = “” Then

colRecipients.Add objAddrEntry

Else

colRecipients.Add recipient

End If

colRecipients.Resolve

oMessage.Subject = subject

oMessage.Text = msg

oMessage.Send

objSession.Logoff

Set objSession = nothing

End Sub


Thanks in advance for your help,

Lorenzo

I have something similar, which also utilzes (VB?). It cotains the command line which creates an editable version of my email for sending. I then check it over and manually hit the SEND button.

However, if I place a “False” statement on the end, this would imply that I do not wish to edit the message before sending and Outlook should just send it …Outlook would then show a warning message that something is trying to send an email using my mailbox ID (the same messages as you are receiving now) and I would have to manually hit that button.

Either way, this requires manual intervention to send an email from an external application, via your own Outlook mailbox.

This is a tricky one and not necessarily Genesys
elated. This might prove useful for you:

http://www.microsoft.com/outlookdev/articles/movs105.htm

…Most noteably, it contains strings which DO send an email with no popups:

Sub NewMailMessage()

Dim ol As New Outlook.Application

Dim ns As Outlook.NameSpace

Dim newMail As Outlook.MailItem



'Return a reference to the MAPI layer

Set ns = ol.GetNamespace("MAPI")



'Create a new mail message item

Set newMail = ol.CreateItem(olMailItem)

With newMail

    'Add the subject of the mail message

    .Subject = "Training Information for October 1997"

    'Create some body text

    .Body = "Here is the training information you requested:" & vbCrLf



    'Add a recipient and test to make sure that the

    'address is valid using the Resolve method

    With .Recipients.Add("[email removed]")

        .Type = olTo

        If Not .Resolve Then

            MsgBox "Unable to resolve address.", vbInformation

            Exit Sub

        End If

    End With



    'Attach a file as a link with an icon

    With .Attachments.Add _

        ("\\Training\training.xls", olByReference)

        .DisplayName = "Training info"

    End With



    'Send the mail message

    .Send

End With



'Release memory

Set ol = Nothing

Set ns = Nothing

Set newMail = Nothing

End Sub

It also contains references to MAPI, as well as SMTP.

Good luck and please let me know if you get anywhere with this?

Tony

If there is a SMTP server on your network you could use Blat. It’s a public domain program which sends the contents of a file as the body of your mail. Very easy to use, you don’t need VB unless you want to insert variables into the message. See http://www.blat.net/194/