Erdenemandal
Regular
Helloo, All
I have a problem to send mail. If connection is witout Proxy it works, but When I configure it with Proxy it gives me a Error ; "COULD NOT ACCES 'CDO:MESSAGE' object"
please, help me how I can solve it. This is my Code
I have a problem to send mail. If connection is witout Proxy it works, but When I configure it with Proxy it gives me a Error ; "COULD NOT ACCES 'CDO:MESSAGE' object"
please, help me how I can solve it. This is my Code
Code:
Public Sub SendEmail(ByVal LevelID As Integer, ByVal PRotsent As Integer)
Dim msg As New MailMessage
Dim d1 As DateTime
Dim ss, ss1 As String
Dim myIni As iniFile = New iniFile(mFileName)
myIni.setActiveSection("general")
ss1 = myIni.getValue("pathNotify")
msg.From = "Test@yahoo.com"
msg.To = ss1
msg.Cc = ""
msg.Bcc = ""
msg.Priority = MailPriority.Normal
msg.Subject = "Result of Patient " & Me.Name & " Level " & LevelID
msg.Body = " Patient Name : " & Me.Name & Chr(13) & " PersonID : " & Me.PersonId & Chr(13) & " Level : " & LevelID & Chr(13) & " Result : " & PRotsent & "%" & Chr(13) & " Date : " & Format(d1.Now, "yyyy\-MM\-dd hh:mm:ss")
If mProxy = 0 Then
Try
' ss = ss1.Substring(ss1.IndexOf("@") + 1)
'ss = msg.From.Substring(msg.From.IndexOf("@") + 1)
SmtpMail.SmtpServer = "yahoo.com"
SmtpMail.Send(msg)
Catch ex As HttpException
MsgBox(ex.Message)
End Try
End If
End Sub