• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

PeterP
#1 Posted : Sunday, November 23, 2008 8:05:48 AM(UTC)
PeterP

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....
Marcus
#2 Posted : Sunday, November 23, 2008 8:00:59 PM(UTC)
Marcus

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.
PeterP
#3 Posted : Monday, November 24, 2008 9:56:09 AM(UTC)
PeterP

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
PeterP
#4 Posted : Tuesday, November 25, 2008 9:31:20 AM(UTC)
PeterP

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.
PeterP
#5 Posted : Wednesday, November 26, 2008 11:28:35 AM(UTC)
PeterP

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.
PeterP
#6 Posted : Saturday, November 29, 2008 6:48:13 PM(UTC)
PeterP

Rank: Member

Joined: 9/17/2008(UTC)
Posts: 22

Is there anyone who has this working... please let me know.
scott.mech
#7 Posted : Sunday, November 30, 2008 4:56:00 PM(UTC)
scott.mech

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
PeterP
#8 Posted : Thursday, December 4, 2008 10:53:25 AM(UTC)
PeterP

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.
Marcus
#9 Posted : Thursday, December 4, 2008 2:16:38 PM(UTC)
Marcus

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.
PeterP
#10 Posted : Thursday, December 4, 2008 7:09:33 PM(UTC)
PeterP

Rank: Member

Joined: 9/17/2008(UTC)
Posts: 22

Thanks Marcus.
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.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012