BV Commerce Forum
»
BV Commerce Support
»
General Support
»
SSL over SMTP AND support for mail servers on ports other than 25 Not working.
Rank: Member
Joined: 9/17/2008(UTC) Posts: 22
|
Hello
I see the new added features in the admin mail settings page, and the changes to the WebAppSettings.vb class, But then they are never used again. I would have definitely thought they would be used in the MailServices.vb class.
The properties that are implemented but never used are:
MailServerUseSsl MailServerPort
Any info on this would be greatly appreciated....
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Peter,
I'm not sure I understand what you're asking. If you set a port other than 25 than all calls to the MailService class should use those settings.
|
|
|
|
Rank: Member
Joined: 9/17/2008(UTC) Posts: 22
|
The latest class does not use these settings. At least the version that I have. Is it just me or can someone else validate that the settings are not used.
Thanks
|
|
|
|
Rank: Member
Joined: 9/17/2008(UTC) Posts: 22
|
Hello Marcus
Can you please send me/ post the MailServices.vb file. The version included in the download does not use the MailServerUseSsl, MailServerPort properties.
Let me know.
|
|
|
|
Rank: Member
Joined: 9/17/2008(UTC) Posts: 22
|
Hello Marcus
Can you please send me/ post the MailServices.vb file. The version included in the download does not use the MailServerUseSsl, MailServerPort properties.
Let me know.
|
|
|
|
Rank: Member
Joined: 9/17/2008(UTC) Posts: 22
|
Is there anyone who has this working... please let me know.
|
|
|
|
Rank: Member
Joined: 4/4/2004(UTC) Posts: 670
|
@PeterP, I took a quick look and can confirm what you are saying for 5.4 rev 5
Scott Mech
|
|
|
|
Rank: Member
Joined: 9/17/2008(UTC) Posts: 22
|
Kinda sucks that no one answered from BV. After some research here is the answer.
Replace the SendMail Function in the Core\Utilities\MailServices.vb file with the line below....
Public Shared Function SendMail(ByVal m As System.Net.Mail.MailMessage, ByVal async As Boolean) As Boolean Dim result As Boolean = False
Try Dim mailServer As String = "localhost" mailServer = WebAppSettings.MailServer
Dim mailClient As New SmtpClient()
If mailServer.Length() > 2 Then mailClient.Host = mailServer Else mailClient.Host = "localhost" End If
If WebAppSettings.MailServerUseSsl Then mailClient.EnableSsl = True mailClient.Port = Convert.ToInt32(WebAppSettings.MailServerPort) End If If WebAppSettings.MailServerUseAuthentication = True Then Dim basicAuthenticationInfo As New System.Net.NetworkCredential(WebAppSettings.MailServerUsername, WebAppSettings.MailServerPassword) mailClient.UseDefaultCredentials = False mailClient.Credentials = basicAuthenticationInfo End If
Dim userState As String = "Mail Message Sent" If async = True Then mailClient.SendAsync(m, userState) Else mailClient.Send(m) End If
result = True Catch Ex As Exception result = False Trace.Write(Ex.Message) ExceptionLog.LogEvent(Ex) End Try
Return result End Function
The Only lines added was .....
If WebAppSettings.MailServerUseSsl Then mailClient.EnableSsl = True mailClient.Port = Convert.ToInt32(WebAppSettings.MailServerPort) End If
Cheers Peter.
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Sorry about the delay in response. Attached is our official mail utilties class that we'll put in the next revision release. The new lines are: Code: ' Set SMTP Port If WebAppSettings.MailServerPort <> String.Empty Then Dim tempPort As Integer = 25 Integer.TryParse(WebAppSettings.MailServerPort, tempPort) If tempPort < 0 Then tempPort = 25 End If mailClient.Port = tempPort End If
mailClient.EnableSsl = WebAppSettings.MailServerUseSsl
File Attachment(s): MailServices.vb (3kb) downloaded 126 time(s).You cannot view/download attachments. Try to login or register.
|
|
|
|
Rank: Member
Joined: 9/17/2008(UTC) Posts: 22
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.