The "Send Using" Configuration is invalid

By VenkatNori ·

I've Windows 2008 Server OS on my server and SQL Server 2005 St. Edition. I'm using one VB6 Application which sends mail, it worked fine on win 2003 svr & sql 2005 combination. But recently I've changed the server to win 2008 ans sql 2005. Now, when I'm testing this application it's not working.

This is the code

Public Sub SendOutlookMail(Subject As String, Recipient As String, Message As Variant)

Dim iMsg
' Dim iConf
' Dim Flds
Dim strHTML

On Error GoTo ErrHdlr

Const cdoSendUsingPort = 2

Set iMsg = CreateObject("CDO.Message")

' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

' Apply the settings to the message.
With iMsg
.To = "" 'Recipient 'ToDo: Enter a valid email address.
.From = "" 'ToDo: Enter a valid email address.
.Subject = Subject ' "This is a test CDOSYS message (Sent via Port 25)"
.HTMLBody = Message 'strHTML
End With

' Clean up variables.
Set iMsg = Nothing
' Set iConf = Nothing
' Set Flds = Nothing

'MsgBox "Mail Sent!"
Exit Sub


Exit Sub
End Sub

Can anyone help me please.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Just to double-check the obvious

by TobiF In reply to The "Send Using" Configur ...

Do you have Outlook on this server (and an account logged on)?

If yes, what version of Outlook did you have on the previous server? And which version now?

The reason I'm asking is that you're calling for Outlook objects in this code.

Collapse -

No outlook

by VenkatNori In reply to Just to double-check the ...

No, Outlook is not installed on this machine. Should I install Outlook or any other way to send mail using the same VB6 code.

Collapse -

This code specifically uses Outlook

by TobiF In reply to No outlook

So, if you want to use this code, then Outlook must be installed (and logged on) for this code to work, since it specifically calls Outlook handles.

It may be possible to send via smtp, for instance, but that's not totally trivial.

Related Discussions

Related Forums