Skip to main content

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.



 


 

what is the SMTP Server value set to in the K2 config file?

I've set it to the name of the mail server which is an exchange server.


I dont know if this is a problem, but a new error msg occurs saying, "The transport failed to connect to the server" 


 


Reply