----------------------------------------------------------- New Message on cochindotnet
----------------------------------------------------------- From: Abu Ismail [KolkataNet] Message 3 in Discussion New Message on MumbaiUserGroup Urgent... If mention SmtpMail.SmtpServer="XYZServer" showing EXCEPTION" Reply Reply to Sender Recommend Message 2 in Discussion From: Abu Ismail New Message on MumbaiUserGroup Urgent... If mention SmtpMail.SmtpServer="XYZServer" showing EXCEPTION" Reply Reply to Sender Recommend Message 1 in Discussion From: Abu Ismail Hi, In a website if I mentioned the SmtpMail.SmtpServer = ServerIP its showing the same error: EXCEPTION Could not access 'CDO.Message' object. If I remove, then this is working fine. The code is as follows. Please help me resolve the problem. Public Function SendMail(ByVal sFrom As String, ByVal sTo As String, ByVal sSubject As String, ByVal sBody As String, Optional ByVal sCc As String = "", Optional ByVal sFiles As String = "", Optional ByVal sSmtpServer As String = "") Try Dim insMail As New MailMessage With insMail .From = Trim(sFrom) .To = Trim(sTo) .Subject = Trim(sSubject) .Body = Trim(sBody) .BodyFormat = MailFormat.Html End With '-- This code is to set the SMTP Server If Trim(sSmtpServer) <> "" Then SmtpMail.SmtpServer = Trim(sSmtpServer) ElseIf ConfigurationSettings.AppSettings("SMTP_Server") <> "" Then SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("SMTP_Server") End If SmtpMail.Send(insMail) Catch err As Exception HttpContext.Current.Response.Write("EXCEPTION " + err.Message + "<br>") End Try End Function Thanks, Abu View other groups in this category. View other groups in this category. ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/cochindotnet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]