Hi folks
Im unable to send emails from my K2 code module. I get the error msg above.
This is the function im using;
Private Function sendServerMail(ByVal K2 As ServerEventContext, _
ByVal fromAddress As String, _
ByVal toAddress As String, _
ByVal Subject As String, _
ByVal Body As String)
'send the mail
Dim objMsg As New System.Web.Mail.MailMessage()
Dim objAttachment As System.Web.Mail.MailAttachment
Dim objSender As System.Web.Mail.SmtpMail
objSender.SmtpServer = SourceCode.K2Utilities.GeneralMod.GetDefaultSMTPServer()
objMsg.From = fromAddress
objMsg.To = toAddress
objMsg.Subject = Subject
objMsg.Body = Body
objSender.Send(objMsg)
End Function
I've also tried changing the line "objSender.SmtpServer = SourceCode.K2Utilities.GeneralMod.GetDefaultSMTPServer()" to hardcode the server name, no luck.