Simplicty and flexibility!


Function::Internal

Send
Send(String)

Send(Blat -to [optional switches (see below)])
Send(Blat -SaveSettings -f -server
[-port ] [-try ] [-profile ]
[-u ] [-pwd ] )
o


Sending emails from anywhere inside a DataEase application. You can use it from a button, derivation, DQL or OML.

Parameters


Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19)
Syntax:
  Blat <filename> -to <recipient> [optional switches (see below)]
  Blat -SaveSettings -f <sender email addy> -server <server addr>
       [-port <port>] [-try <try>] [-profile <profile>]
       [-u <login id>] [-pwd <password>]
  or
  Blat -install <server addr> <sender's addr> [<try>[<port>[<profile>]]] [-q]
  Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q]
  Blat -h
-------------------------------- Installation ---------------------------------
-SaveSettings   : store common settings to the Windows Registry.  Takes the
                  same parameters as -install, and is only for SMTP settings.
-install[SMTP|NNTP|POP3|IMAP] <server addr> <sender email addr> [<try n times>
                [<port> [<profile> [<username> [<password>]]]]]
                : set server, sender, number of tries and port for profile
                  (<try n times> and <port> may be replaced by '-')
                  port defaults are SMTP=25, NNTP=119, POP3=110, IMAP=143
                  default profile can be specified with a '-'
                  username and/or password may be stored to the registry
                  order of options is specific
                  use -installNNTP for storing NNTP information
                  use -installPOP3 for storing POP3 information
                      (sender and try are ignored, use '-' in place of these)
                  use -installIMAP for storing IMAP information
                      (sender and try are ignored, use '-' in place of these)
--------------------------------- The Basics ----------------------------------
<filename>      : file with the message body to be sent
                  if your message body is on the command line, use a hyphen (-)
                  as your first argument, and -body followed by your message
                  if your message will come from the console/keyboard, use the
                  hyphen as your first argument, but do not use -body option.
-of <file>      : text file containing more options (also -optionfile)
-to <recipient> : recipient list (also -t) (comma separated)
-tf <file>      : recipient list filename
-cc <recipient> : carbon copy recipient list (also -c) (comma separated)
-cf <file>      : cc recipient list filename
-bcc <recipient>: blind carbon copy recipient list (also -b)
                  (comma separated)
-bf <file>      : bcc recipient list filename
-maxNames <x>   : send to groups of <x> number of recipients
-ur             : set To: header to Undisclosed Recipients if not using the
                  -to and -cc options
-subject <subj> : subject line, surround with quotes to include spaces(also -s)
-ss             : suppress subject line if not defined
-sf <file>      : file containing subject line
-bodyF <file>   : file containing the message body
-body <text>    : message body, surround with quotes (") to include spaces
-sig <file>     : text file containing your email signature
-tag <file>     : text file containing taglines, to be randomly chosen
-ps <file>      : final message text, possibly for unsubscribe instructions
----------------------------- Registry overrides ------------------------------
-p <profile>    : send with server, user, and port defined in <profile>
                : use username and password if defined in <profile>
-profile        : list all profiles in the Registry
-server <addr>  : specify SMTP server to be used (optionally, addr:port)
-serverSMTP <addr>
                : same as -server
-serverNNTP <addr>
                : specify NNTP server to be used (optionally, addr:port)
-serverPOP3 <addr>
                : specify POP3 server to be used (optionally, addr:port)
                  when POP3 access is required before sending email
-serverIMAP <addr>
                : specify IMAP server to be used (optionally, addr:port)
                  when IMAP access is required before sending email
-f <sender>     : override the default sender address (must be known to server)
-i <addr>       : a 'From:' address, not necessarily known to the server
-port <port>    : port to be used on the SMTP server, defaults to SMTP (25)
-portSMTP <port>: same as -port
-portNNTP <port>: port to be used on the NNTP server, defaults to NNTP (119)
-portPOP3 <port>: port to be used on the POP3 server, defaults to POP3 (110)
-portIMAP <port>: port to be used on the IMAP server, defaults to IMAP (110)
-u <username>   : username for AUTH LOGIN (use with -pw)
-pw <password>  : password for AUTH LOGIN (use with -u)
-pu <username>  : username for POP3 LOGIN (use with -ppw)
-ppw <password> : password for POP3 LOGIN (use with -pu)
-iu <username>  : username for IMAP LOGIN (use with -ppw)
-ipw <password> : password for IMAP LOGIN (use with -pu)
---------------------- Miscellaneous RFC header switches ----------------------
-organization <organization>
                : Organization field (also -o and -org)
-ua             : include User-Agent header line instead of X-Mailer
-x <X-Header: detail>
                : custom 'X-' header.  eg: -x "X-INFO: Blat is Great!"
-noh            : prevent X-Mailer/User-Agent header from showing Blat homepage
-noh2           : prevent X-Mailer header entirely
-d              : request disposition notification
-r              : request return receipt
-charset <cs>   : user defined charset.  The default is ISO-8859-1
-a1 <header>    : add custom header line at the end of the regular headers
-a2 <header>    : same as -a1, for a second custom header line
-dsn <nsfd>     : use Delivery Status Notifications (<A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc3461.txt">RFC 3461</A>)
                  n = never, s = successful, f = failure, d = delayed
                  can be used together, however N takes precedence
-hdrencb        : use base64 for encoding headers, if necessary
-hdrencq        : use quoted-printable for encoding headers, if necessary
-priority <pr>  : set message priority 0 for low, 1 for high
-sensitivity <s>   : set message sensitity 0 for personal, 1 for private,
                  2 for company-confidential
----------------------- Attachment and encoding options -----------------------
-attach <file>  : attach binary file(s) to message (filenames comma separated)
-attacht <file> : attach text file(s) to message (filenames comma separated)
-attachi <file> : attach text file(s) as INLINE (filenames comma separated)
-embed <file>   : embed file(s) in HTML.  Object tag in HTML must specify
                  content-id using cid: tag.  eg: <img src="cid:image.jpg">
-af <file>      : file containing list of binary file(s) to attach (comma
                  separated)
-atf <file>     : file containing list of text file(s) to attach (comma
                  separated)
-aef <file>     : file containing list of embed file(s) to attach (comma
                  separated)
-base64         : send binary files using base64 (binary MIME)
-uuencode       : send binary files UUEncoded
-enriched       : send an enriched text message (Content-Type=text/enriched)
-unicode        : message body is in 16- or 32-bit Unicode format
-html           : send an HTML message (Content-Type=text/html)
-alttext <text> : plain text for use as alternate text
-alttextf <file>: plain text file for use as alternate text
-mime           : MIME Quoted-Printable Content-Transfer-Encoding
-8bitmime       : ask for 8bit data support when sending MIME
-multipart <size>
                : send multipart messages, breaking attachments on <size>
                  KB boundaries, where <size> is per 1000 bytes
-nomps                : do not allow multipart messages
---------------------------- NNTP specific options ----------------------------
-groups <usenet groups>
                : list of newsgroups (comma separated)
-------------------------------- Other options --------------------------------
-xtndxmit       : Attempt to use POP3 to transmit when accessing POP3 first
-h              : displays this help (also -?, /?, -help or /help)
-q              : suppresses all output to the screen
-debug          : echoes server communications to a log file or screen
                  (overrides -q if echoes to the screen)
-log <file>     : log everything but usage to <file>
-timestamp      : when -log is used, a timestamp is added to each log line
-overwritelog   : when -log is used, overwrite the log file
-ti <n>         : set timeout to 'n' seconds.  Blat will wait 'n' seconds for
                  server responses
-try <n times>  : how many times blat should try to send (1 to 'INFINITE')
-binary         : do not convert ASCII | (pipe, 0x7c) to CrLf in the message
                  body
-hostname <hst> : select the hostname used to send the message via SMTP
                  this is typically your local machine name
-raw            : do not add CR/LF after headers
-delay <x>      : wait x seconds between messages being sent when used with
                  -maxnames or -multipart
-comment <char> : use this character to mark the start of commments in
                  options files and recipient list files.  The default is ;
-superdebug     : hex/ascii dump the data between Blat and the server
-superdebugT    : ascii dump the data between Blat and the server
-------------------------------------------------------------------------------
Note that if the '-i' option is used, <sender> is included in 'Reply-to:'
and 'Sender:' fields in the header of the message.
Optionally, the following options can be used instead of the -f and -i
options:
-mailfrom <addr>   The <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc821.txt">RFC 821</A> MAIL From: statement
-from <addr>       The <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc822.txt">RFC 822</A> From: statement
-replyto <addr>    The <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc822.txt">RFC 822</A> Reply-To: statement
-returnpath <addr> The <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc822.txt">RFC 822</A> Return-Path: statement
-sender <addr>     The <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc822.txt">RFC 822</A> Sender: statement
For backward consistency, the -f and -i options have precedence over these
<A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc822.txt">RFC 822</A> defined options.  If both -f and -i options are omitted then the
<A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc821.txt">RFC 821</A> MAIL FROM statement will be defaulted to use the installation-defined
default sender address.

Returns/Result


Examples


You need to configure the SMTP server before you can use the function:
Send(blat -installSMTP smtp.yourserver.com you@yourdomain.com 1 587 - Your username)

Ex.

Send(blat -installSMTP smtp.mymail.com deuser@mymail.com 1 587 - deuser@mymail.com secretpw)

When the server is configured you can send a test message like the one below:

Send(blat -to deuser@mymail.com -subject "I am testing Email from DataEase 8" -body "This seems to work brilliantly!Thanks! deuser@mymail.Com")

All transferable parameters in DataEase are limited to 255 characters, and this is in most cases to short for sending meaningful messages so you need to send the body as a file attachment for larger mails. For this we use the new Memo and File functions.

You can for instance edit the Email body in HTMLedit and then save it to a file with MemoWriteToFile().

and then you include the body file and attachments in the configuration string.

ex.

Send(Sendstring) where the sendstring looks like this:

blat -to customer@dataease.com -html -subject "This is a testmail" -bodyf "C:\Users\Ulrik\Documents\My DataEase\DE8DATA\SimpleMailTest\mail\00001.html" -af "C:\Users\Ulrik\Documents\My DataEase\DE8DATA\SimpleMailTest\mail\00001.att"

As you can see here you need to format with " which is not straight forward in traditional DataEase. In DE8 we have included CHR() as a function and quote is CHR(34).

Formula in sendstring looks like this:

concat("blat -to ",To ," -html -subject ", chr(34) ,Subject,chr(34) ," -bodyf ",chr(34),mailfile,chr(34), if (MemoLength(Attachments) >0,concat(" -af ",chr(34),AttachmentFile,chr(34) ),""))

You will find examples doing this in both the CRM app included with DE8 and if you create a new application from the Default Template.

In the CRM app we also have a landing page which is the first page loaded after login to the app. This landing page configure the email server for the active user before progressing to loading the Addressbook. You can do something similar to insure that the email server is configured before you start sending emails.

Reference

See Also


On the forum about Send

How to send reports as a PDF format.

Can you help! I am trying to email my invoices and reports using PDF format.Your help will be much appreciated!...

Product: DataEase 6.x. Written by joe peart 09/11/14 at 12:06:34

SendEmail

Have done some tests with the use of "SendEmail" this works well using only an attachment, but when more are admitted will be no email received, Are there opportunities for multiple attachments, if so, how shall command line formulated. Taught...

Product: Dataease [{8}]FIVE. Written by Tor Nerland 13/12/14 at 09:58:09

Re:SendEmail

Simples...You don't add a new -a you simply space the attachments&nbsp;sendemail -f tnerla@broadpark.no ........... -u Test2xx -o message-content-type...

Product: Dataease [{8}]FIVE. Written by DataEase 13/12/14 at 10:52:08

Re:Re:SendEmail

Takk for raskt svar. Mitt neste spørsmål er: Er det noen mulighet for å omgå taket på 255 tegn som DE har ?.Translation for our other deserving users:Thanks for the quick answer.Next question: Is there a way to get aroun...

Product: Dataease [{8}]FIVE. Written by Tor Nerland 13/12/14 at 12:34:57

Re:Re:Re:SendEmail

This is a question that we deliberate over a lot to be honest.The problem is that DE is 8 bit at "heart". This sound crazy and outdated, but in reality it is brilliant, because it means that it is blitzingly&nbsp;fast.With hear we mean...

Product: Dataease [{8}]FIVE. Written by DataEase 13/12/14 at 12:44:08

Re:Re:Re:Re:SendEmail

Adding to the last post, we firstly need to correct the "deliberate error"&nbsp;in which the arguments of the WriteToFile() function appear in reversed order :-)&nbsp; For anyone who is interested, the following coding will generate a .bat file which...

Product: Dataease [{8}]FIVE. Written by Bill Nicholson 02/01/15 at 17:36:04

Re:Re:Re:Re:Re:SendEmail

I am afraid that it is too late to correct the "deliberate error" of the argument order in WriteToFile(). The problem is that it is the complimentary function to MemoWriteToFile() so it has the same argument order. Obviously you are correct, and it sh...

Product: Dataease [{8}]FIVE. Written by DataEase 05/01/15 at 09:14:44

Re:Re:Re:Re:Re:SendEmail

So to the issue at hand here.... and this is a "Can't see the forest for all the threes issue!"The problem is that you call your bat file SendEmail.bat.... so you basically call your own bat file over and over and over and over again instead o...

Product: Dataease [{8}]FIVE. Written by DataEase 07/01/15 at 14:23:13

Re:Re:Re:Re:Re:Re:SendEmail

I seem to be particularly slow on this one. As ever when there's a problem one should go back to first principles.I have compiled a file called "testing.bat"&nbsp;with the following commands:ECHO onPAUSE We are now in the bat file...

Product: Dataease [{8}]FIVE. Written by Bill Nicholson 07/01/15 at 16:09:43

Re:Re:Re:Re:Re:Re:Re:SendEmail

You have a "knack" for finding/testing the things that don't work ;-)Sorry, can't help it, just have to wind you up.I did the same as you, and realized that ExecuteFile() will not give you any Console Output i.e. the Bat is run but any...

Product: Dataease [{8}]FIVE. Written by DataEase 07/01/15 at 18:57:26

Re:Re:Re:Re:Re:Re:Re:Re:SendEmail

Look I am just an average Joe trying to develop some applications at DE's outer edge and I keep running up against these problems - I am not looking for them, honest. I created the simple test problem to get the hang of ExecuteFile(), couldn't make it...

Product: Dataease [{8}]FIVE. Written by Bill Nicholson 07/01/15 at 20:36:07

send an email with several recipients

I’m trying to send an email via dataease. Over all this is a very useful function, but my goal is to send an email to many recipients and&nbsp; the “send” command use simply a string with a limitation of 255 characters that don’t fit all the recipient...

Product: Dataease [{8}]FIVE. Written by Marco Marchesi 17/08/15 at 09:08:30

Re:send an email with several recipients

It is a problem that functions cannot take longer arguments than 255 in DataEase, but not one that there is any easy way around.Both email functions in DE8.x is "third party" and we have scheduled a built in function for some time but as the t...

Product: Dataease [{8}]FIVE. Written by DataEase 17/08/15 at 11:32:01

Re:Re:send an email with several recipients

Thank you for your reply. I know that it's not an error. I wrote into the forum only for a suggestion. Anyway&nbsp; in the meantime I found an alternative solution. I mean&nbsp;1) Create a .cmd file using the complete syntax of blat command usi...

Product: Dataease [{8}]FIVE. Written by Marco Marchesi 17/08/15 at 12:03:16

Re:Re:Re:send an email with several recipients

To be honest, that too was on my mind but for you to come up with is creative and elegant, for me to suggest it sound like we are asking you to make your own product ;-)So you get all the credit ;-)...

Product: Dataease [{8}]FIVE. Written by DataEase 17/08/15 at 12:12:54

SendEmail

Trying to send mail from DataEase using SendEmail here is my script. It creates the batch file but no email received. What haven't I&nbsp;done correctly?define "retval" text .<span style="col...

Product: Dataease [{8}]FIVE. Written by BLESSED SHUMBA 18/09/15 at 13:05:08

Re:SendEmail

Try running the batch file in a command window. &nbsp;That way you should see messages returned by sendemail.exe.RegardsJon...

Product: Dataease [{8}]FIVE. Written by Jon Worthington 18/09/15 at 14:56:05

How do you send control strings to HP LaserJet printers. using LegEasy4dos?

How do you send control strings to HP LaserJet printers. using LegEasy4dos?...

Product: LegEasy 4DOS. Written by Bob 16/04/18 at 20:44:03

Re:How do you send control strings to HP LaserJet printers. using LegEasy4dos?

LegEasy4DOS Professional 1.0 support Epson MX80 native as emulation. In 2.0 we will support HPCL or HP Laserjet as well which will cover all practical implementations...

Product: LegEasy 4DOS. Written by DataEase 16/04/18 at 20:46:24

What version of TLS is used by SendEmail?

HiAs of October 31, 2018, Office 365 will no longer support TLS 1.0 and 1.1.&nbsp;ReferencePlease can you confirm which ve...

Product: Dataease [{8}]FIVE. Written by Jon Worthington 26/10/18 at 11:39:02

Re:What version of TLS is used by SendEmail?

SendEmail is a third party software included in DE8 to faciliate sending emails directly from DE8. This feature will be replaced in DE9 with native IMAP/SMTP/POP support for two way email communication.SenEmail.exe is no longer supported by th...

Product: Dataease [{8}]FIVE. Written by DataEase 30/10/18 at 16:17:57

Sending a report to different printers

Hi there, I am using Dataease version 6.57. I have a question: how can I send a report to different printers simultaneously?...

Product: DataEase 6.x. Written by Mohammad AL 29/08/22 at 11:42:57

Re:Sending a report to different printers

In DE6 this is tricky. If my memory don't fail me, there was some CDF's you could use to do this but I'm not sure if they are still available - maybe someone on her can help you.However in DE8 the first thing we introduced was Workstation p...

Product: DataEase 6.x. Written by DataEase 30/08/22 at 11:10:46

On the blog about Send

Mail send action now handles attachments

The mailsend action module has got a new method named sendmailwithattachments. This method do the same as mailsend, but can also take a list of files as a parameter. Make sure you have DG3 v.0.12.978 or newer.This is how the mailsend act...

Product: DataEase Generation 3. Written by DataEase Development 17/04/13 at 12:40:47

How to send parametes in a chain of redirected pages (simulate the DOS chain menu in DG3)

User that have been using DataEase for a while know that a common problem is that you lock your self out of a table if you try to do things that need a full table lock (delete all) in the same dql that you do updates. To overcome this, we used to use...

Product: DataEase Generation 3. Written by DataEase Development 30/07/13 at 13:22:44

New functionality in DataEase 8.5 - MoveToFront/SendToBack* (Ver. 8.5.0.2128)

Download sample DataEase for Windows object order and priority has been somewhat of a mystery since...

Product: Dataease [{8}]FIVE. Written by DataEase 21/01/16 at 17:59:26


dg3_HelpView