SetMailServer
Configures the mail server to use for sending mail. Use this action only if you are sending emails with CDOSYS.
Syntax
bool SetMailServer (StrParam)
Parameters
The IP or DNS address of the outgoing mail (SMTP) server.Returns
Always True.Level
All levels.Details
Sets the address of the outgoing mail (SMTP) server. This server might be the same mail server that you configure in your mail program. The server must be accessible from the computer that runs the email actions. This action must be the first action in an email rule, if the CDOSYS object is being used.Use this action only if you are sending emails with CDOSYS. To use CDOSYS, this action must be called before any of the other email actions. If this action is not called before other email actions, these actions use Outlook for sending emails.
You can use Email actions to direct a task to compose and send emails that contain information and attachments. Email actions use the Windows CDOSYS library to send email by your preferred SMTP mail server. The CDOSYS object is included with Windows 2000 and higher versions. Alternatively, Email actions can use the Outlook object but it is not recommended.
One of these two libraries (CDOSYS or Outlook) must be registered on the computer that runs the rules that employ email actions.
Outlook is primarily useful for demonstration purposes because it is not suitable for unattended operation. It requires the Outlook user to be logged in to the computer, and security prompts might be displayed for each message sent.
- Example:
SetMailServer("mail.YourISP.com") SetSender("paul@adomain.com") SetRecipients("lisa@adomain.com") SetSubject("Document Integrity") SetEMailBody("Document Page Types and counts are accurate. Thanks for your help.") SendEMail()