Author |
|
Ramana Guest Group
Joined: 10 November 2003
Online Status: Online Posts: 262
|
Posted: 21 May 2004 at 9:44am | IP Logged
|
|
|
Hi,
I am trying to write an VB app, which has to send mails with Secure Password authentication for SMTP. Is it possible with MailBee SMTP Component. If yes, Can anybody post a sample code.
Thanks in advance,
Ramana
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 21 May 2004 at 10:12am | IP Logged
|
|
|
Yes, you can easily send emails with MailBee SMTP using SPA.
The sample code is shown below.
Dim objSMTP
Set objSMTP = CreateObject("MailBee.SMTP")
' Enable logging SMTP session into a file,
' useful for debugging
objSMTP.EnableLogging = True
objSMTP.LogFilePath = "C:\smtp_log.txt"
objSMTP.ClearLog
objSMTP.LicenseKey = "your key"
objSMTP.ServerName = "mail.server.com"
' Enable secure password authentication (SPA)
objSMTP.AuthMethod = 4
' Username and passsword for SPA
objSMTP.UserName = "user"
objSMTP.Password = "pass"
objSMTP.Message.FromAddr = "from@addr.com"
objSMTP.Message.ToAddr = "to@addr.com"
objSMTP.Message.Subject = "Hello"
objSMTP.Message.BodyText = "Message sent using SPA"
If objSMTP.Connect Then
objSMTP.Send
objSMTP.Disconnect
End If
|
Back to Top |
|
|
Ramana Guest Group
Joined: 10 November 2003
Online Status: Online Posts: 262
|
Posted: 21 May 2004 at 10:30am | IP Logged
|
|
|
Alex,Thanks for your response. I am getting 'Unrecognized authentication type' error, when trying to send mail. here is entire log.
10:22:43 [Connecting to server smtp.email.msn.com at port 25 from domain ......]
10:22:43 [Entering ESMTP authentication mode]
10:22:43 [Sending ehlo]
10:22:43 [Using NTLM authentication]
10:22:43 [Error: Negative or void server response]
10:22:43 [Server responded: 504 5.7.4 Unrecognized authentication type.\r\n]
10:22:43 [Possible error reason: NTLM authentication type (auth ntlm command) is not supported by this server]
10:22:43 [Error: Connection failure]
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 21 May 2004 at 11:02am | IP Logged
|
|
|
This is because your SMTP server does not support particular type of SPA. You can try to send using another value for SMTP.AuthMethod property:
AuthMethod=3 enables secure CRAM-MD5 authentication
If this also doesn't work, your server does not support SPA. You can still use insecure authentication with
AuthMethod=2.
|
Back to Top |
|
|