UserName Property


The name of the user account on the mail server to be used for ESMTP authentication during connection (if AuthMethod>0).

If AuthMethod property has default value (AuthMethod=0), this property is not used.

This can be left an empty string if you're using Integrated Windows Authentication. See AuthMethod property for details.

Usually this is the first part of the email address (e.g. "bill" for "bill@host.com"). Sometimes, however, it can be full email address or something else (it depends on SMTP account settings).


Value Type: String
Parameters: None 

Usage example:

Dim Mailer
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.SMTP")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.SMTP")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.ServerName = "mailserver.com"
Mailer.UserName = "MyName"
Mailer.Password = "MyPassword"
Mailer.AuthMethod = 1 ' Using PLAIN authentication method supported by most SMTP servers
Mailer.Connect
If Mailer.Connected Then
  MsgBox "Connected using PLAIN authentication method"
  Mailer.Disconnect
End If

See Also:

Password Property
AuthMethod Property
ServerName Property
Connect Method


Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.