Email

<< Click to Display Table of Contents >>

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

Email

Description

This command allows to set parameters for sending an email through the sendEmail command.

Syntax

call DBWShell("Email action parameter value")

Parameters

action

"NEW"

parameter

Notification

value

UserID@companyID

action

"DATA"

parameter

SUBJECT

value

the email subject

parameter

BODY_TXT

value

the email body in simple text format

parameter

BODY_HTML

value

the email body in html format

parameter

ATTACHMENT

value

a valid file path for sending the file as attachment to the eMail message

Remarks

The command must be called once with action=NEW to instantiate the email and then other times with action=DATA to set the other required parameters:

EMail New Notification <[email protected]>

EMail Data SUBJECT <emailsubject>
EMail Data BODY_HTML <body>
...
EMail Data BODY_HTML <body>
EMail Data ATTACHMENT <fileattach>
SendEMail

See also

Email related commands and functions in Standard Library

Example

sub main()

 nameToAddress = "[email protected]"
 subject = "Test email"
 attachment = "c:\temp\myAttachment.zip"
 BODY_HTML01 = "<html><body>"
 BODY_HTML02 = "<h1 align=""center""><FONT face=""Verdana"" size=""5"">This is a test</FONT></h1>"
 BODY_HTML03 = "</br>"
 BODY_HTML04 = "<p>these are some lines</p>"
 BODY_HTML05 = "</body></html>"
 DBWShell("EMail New Notification " & nameToAddress )
 DBWShell("EMail Data SUBJECT " & replace(SUBJECT," ","|"))
 DBWShell("EMail Data BODY_HTML " & replace(BODY_HTML01," ","|"))
 DBWShell("EMail Data BODY_HTML " & replace(BODY_HTML02," ","|"))
 DBWShell("EMail Data BODY_HTML " & replace(BODY_HTML03," ","|"))
 DBWShell("EMail Data BODY_HTML " & replace(BODY_HTML04," ","|"))
 DBWShell("EMail Data BODY_HTML " & replace(BODY_HTML05," ","|"))
 DBWShell("EMail Data ATTACHMENT " & attachment)
 DBWShell("SendEMail")
end sub