Issue with authentication

Hello,


What is the equivalent of: smtp.EnableSsl = False?

I have tried using:

client.SecurityOptions = Aspose.Email.SecurityOptions.Auto

and

client.SecurityOptions = Aspose.Email.SecurityOptions.None

but none work. I am using mail.datascsgrp.com (does not support SSL) with Aspose and System.Net.Mail. With System.Net.Mail it works fine but with Aspose it fails to send email.

Your help will be greatly appreciated.

Thank you,

Faruk

Hi Faruk,

Thank you for writing to Aspose Support team.

SecurityOptions.None is the recommended option for connecting to SMTP servers without SSL. We tested the below sample code and it worked for us.

' Declare msg as MailMessage instance

Dim msg As New MailMessage()

msg.To = "user@gmail.com"

msg.From = "user@local.com"

msg.Subject = "Test"

' Create an instance of SmtpClient class

Dim client As New SmtpClient()

' Specify your mailing host server, Username, Password, Port # and Security option

client.Host = "localhost"

client.Username = "user@local.com"

client.Password = "password"

client.Port = 25

client.SecurityOptions = SecurityOptions.None

Try

' Client.Send will send this message

client.Send(msg)

Catch ex As Exception

System.Diagnostics.Trace.WriteLine(ex.ToString())

End Try


<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>Please share your complete sample code and a test account to reproduce the issue you are facing while connecting to your server. We’ll analyze it further to assist you accordingly.