DBWSendEMail1

<< Click to Display Table of Contents >>

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

DBWSendEMail1

Description

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

Syntax

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

Parameters

SendTo

receiver

Subject

e-mail subject

MailBody

body of the e-mail message

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

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="Luca Maselli <[email protected]>"
 Subject="test e-mail"
 MailBody="this is the first line of a test message" & vbcrlf
 MailBody = MailBody & "this is the second line of a test message" & vbcrlf
 MailBody = MailBody & "this is the last line of a test message"
 SendFrom="Luca Maselli <[email protected]>"
 DisplayMsg=TRUE
 AttachmentPath= "c:\temp\test_file.zip"
 SMTPServer="my.smtp.server.com"
 LoginUser="[email protected]"
 LoginPassword="xxxyyyzzz"
 DBWSendEmail1 SendTo, Subject, MailBody, SendFrom, DisplayMsg, AttachmentPath, SMTPServer, LoginUser, LoginPassword
End Sub