wodSmtpServer ActiveX Control - MailFrom Method
      
 

Description

Called when user specifies sender of the message


Return Type

None  


Syntax

object.MailFrom Owner, User, Address, Action



The MailFrom Method syntax has these parts:

Part Description
object An expression evaluating to an object of type wodSmtpNotify.
Owner Required. A wodSmtpServer object. Reference to wodSmtpServerCom instance that called this callback method.
User Required. A SmtpUser object. Reference to the user who send this command.
Address Required. A String value. Email address or account name user provided.
Action Required. A SmtpActions enumeration, as described in settings. You should set it to Allow or Deny, depending if you will accept the sender or not.

Settings

The settings for Action are:

Constant Value Description
 Deny 0 Deny execution of the action.
 Allow 1 Allow to execute action.
 SilentDeny 2 Silently deny execution of the action.
 SilentAllow 3 Silently allow to execute action.

Remarks

NOTE: This method is called only if you implemented IwodSmtpNotify interface in your application, and wodSmtpServer1.Notification property has received reference to instance of your implementation.

SMTP protocol specification says that before message is posted to the server, client should provide information about sender and recipient (among others) of the message, so that server can decide if it will accept the message or not. For this purpose, when client connects to server, he will issue 'MAIL FROM' command following his email or account name information. This isn't necessarily the same email address or name as provided by 'FROM:' header later in the message, so please don't try to look for it there later on.

When you receive this notification method, you should decide if your server will accept the message or not. For example, if you want to set up sort of Spam filter, you can just ignore emails received from certain email addresses, or even from certain computers on Internet. You can do this by evaluating contents of Address variable, and set Action = Allow to allow client to continue posting message, or Action = Deny to deny posting. Client will receive an error in that case.

Later, you can access address entered here using MailFrom property.