DBWSendEMail3

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference > PDMSystem >

DBWSendEMail3

Description

Send an e-mail to the specified address; it lets you specify the body format, SMTP server, login and password

It allows to specify more than one receiver; the first one will be considered as main recipient while the others will be treated as CC contacts.

Syntax

Sub DBWSendEMail3(SendTo, Subject, MailBody, HTML, SendFrom, DisplayMsg, AttachmentPath, SMTPServer, LoginUser, LoginPassword)

Parameters

SendTo

a semicolon separated list of the receivers
allowed formats are:
"John Doe <[email protected]>; Bob Marley < [email protected]>; Paul Freeman <[email protected]>"
or simply
"[email protected]; [email protected]; [email protected]"

Subject

e-mail subject

MailBody

body of the e-mail message

HTML

format of the e-mail body
FALSE: simple text format
TRUE: HTML text format

SendFrom

sender

DisplayMsg

Boolean.
If set to TRUE it displays the e-mail and let the user choose to send.
If set to FALSE it sends the e-mail without displaying any window.

AttachmentPath

path of document to attach to the e-mail.
Entry an empty string "" if you have no file to attach.

SMTPServer

outgoing mail server; it's also possible to specify a port:
my.smtp.server.com:2525

LoginUser

user login on the SMTP server

LoginPassword

password to log on the SMTP server

 

See also

Email related commands and functions

 

Example

Sub Main()
 DBWinit(TRUE)
 SendTo="John Doe <[email protected]>; Bob Marley <[email protected]>; Paul Freeman <[email protected]>"
 Subject="my test e-mail"
 MailBody="this is a test message<BR>this is a <FONT COLOR=red>red message"
 SendFrom="Hugo Stiglitz <[email protected]>"
 DisplayMsg=TRUE
 HTML=TRUE
 AttachmentPath= "c:\temp\test_file.zip"
 SMTPServer="my.smtp.server.com"
 LoginUser="[email protected]"
 LoginPassword="xxxyyyzzz"
 DBWSendEMail3 SendTo, Subject, MailBody, HTML, SendFrom, DisplayMsg, AttachmentPath, SMTPServer, LoginUser, LoginPassword
End Sub