I have written code to send Email in ASP.NET with VB language. I have tested it on local host and my email is working. I am using Gmail settings for sending email with smtp.gmail.com and 587 port number. But when i have published the website Email is not sent. What could be the problem?? will it be a server problem??
EDIT Problem with Google Apps email/smtp to send mails from website as given in this link i have tried below code
Public Class clsSSL
Public Function AcceptAllCertifications(ByVal sender As Object, ByVal certification As System.Security.Cryptography.X509Certificates.X509Certificate, ByVal chain As System.Security.Cryptography.X509Certificates.X509Chain, ByVal sslPolicyErrors As System.Net.Security.SslPolicyErrors) As Boolean
Return True
End Function
End Class
new class in same vb file which i called it as below... this works well on local host..
ServicePointManager.ServerCertificateValidationCallback = AddressOf New clsSSL().AcceptAllCertifications
But i got security exception as below
开发者_如何转开发Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
What could be the solution
EDIT 2
I have shared hosting on godaddy.com. Can i change some setting regarding smtp.gmail.com or port number in that account??? I dont exactly know how to change settings...
It might be a firewall issue on the live server. Try looking at what ports are blocked.
精彩评论