Difference between revisions of "MAILSEND()"
From Lianjapedia
Helen.george (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 11: | Line 11: | ||
The MAILSEND() function is used for sending mail. If successful the MAILSEND() will return .T. or .F. otherwise. The MAILERROR() function can be used to return the error message if the MAILSEND() fails. | The MAILSEND() function is used for sending mail. If successful the MAILSEND() will return .T. or .F. otherwise. The MAILERROR() function can be used to return the error message if the MAILSEND() fails. | ||
− | {| class="wikitable" width=100% | + | {| class="wikitable" width="100%" |
− | !Parameters||Required||Default||Description | + | !width="15%"|Parameters||width="15%"| Required||width="15%"| Default||Description |
|- | |- | ||
|valign="top"|<expC1>||valign="top"|No||valign="top"|Your node||valign="top"|The from name of the sender | |valign="top"|<expC1>||valign="top"|No||valign="top"|Your node||valign="top"|The from name of the sender | ||
Line 26: | Line 26: | ||
|valign="top"|<expC6>||valign="top"|No||valign="top"|None||A comma separated list of names of files to be sent as attachments | |valign="top"|<expC6>||valign="top"|No||valign="top"|None||A comma separated list of names of files to be sent as attachments | ||
|- | |- | ||
− | |valign="top"|<expL1>||valign="top"|No||valign="top"|None|| | + | |valign="top"|<expL1>||valign="top"|No||valign="top"|None||Ignored. |
|- | |- | ||
|<expC7>||No||text/plain||Content type. | |<expC7>||No||text/plain||Content type. | ||
Line 41: | Line 41: | ||
endif | endif | ||
− | fromname = "info@ | + | fromname = "info@lianja.com" |
− | tonames = "fred@ | + | tonames = "fred@lianja.com;sue@lianja.com" |
− | ccnames = "bert@ | + | ccnames = "bert@lianja.com;linda@lianja.com" |
subject = "For your information" | subject = "For your information" | ||
message = "Dear All" + chr(10) + "Here are the files you asked for." + chr(10) + ; | message = "Dear All" + chr(10) + "Here are the files you asked for." + chr(10) + ; | ||
Line 58: | Line 58: | ||
endif | endif | ||
− | fromname = "info@ | + | fromname = "info@lianja.com" |
− | tonames = "fred@ | + | tonames = "fred@lianja.com" |
ccnames = "" | ccnames = "" | ||
subject = "For your information" | subject = "For your information" | ||
message = "email.htm" | message = "email.htm" | ||
attachments = "" | attachments = "" | ||
− | content = " | + | content = "text/html" |
sendmail(fromname,tonames,ccnames,subject,message,attachments,.F.,content) | sendmail(fromname,tonames,ccnames,subject,message,attachments,.F.,content) | ||
mailclose() | mailclose() |
Latest revision as of 06:57, 2 February 2015
Contents
Purpose
Function to send mail
Syntax
MAILSEND([<expC1>],<expC2>, [<expC3>], [<expC4>], <expC5> [,<expC6> [, <expL1>]] [, <expC7>])
See Also
CLOSEMAIL(), COUNTMAIL(), DELETEMAIL(), MAILCLOSE(), MAILATTACH(), MAILCOUNT(), MAILDELETE(), MAILERROR(), MAILHEADER(), MAILNODENAME(), MAILOPEN(), MAILREAD(), MAILSAVEAS(), MAILUSERNAME(), OPENMAIL(), READMAIL(), SENDMAIL()
Description
The MAILSEND() function is used for sending mail. If successful the MAILSEND() will return .T. or .F. otherwise. The MAILERROR() function can be used to return the error message if the MAILSEND() fails.
Parameters | Required | Default | Description |
---|---|---|---|
<expC1> | No | Your node | The from name of the sender |
<expC2> | Yes | None | A semi-colon separated list of recipient names to receive the message |
<expC3> | Yes | None | A semi-colon separated list of cc recipient names to receive the message |
<expC4> | No | None | The subject of the message |
<expC5> | Yes | None | The message to be sent. This can be a character string, a variable containing a character string or a character string containing the name of a text file. |
<expC6> | No | None | A comma separated list of names of files to be sent as attachments |
<expL1> | No | None | Ignored. |
<expC7> | No | text/plain | Content type. |
Example
// Open SMTP for sending m_open = mailopen("mailserver.company.com","username","password","SMTP") if not m_open dialog box mailerror() return endif fromname = "info@lianja.com" tonames = "fred@lianja.com;sue@lianja.com" ccnames = "bert@lianja.com;linda@lianja.com" subject = "For your information" message = "Dear All" + chr(10) + "Here are the files you asked for." + chr(10) + ; "Best regards" + chr(10) + "Sam" attachments = "info.doc, info.xls" mailsend(fromname,tonames,ccnames,subject,message,attachments) mailclose() // Open SMTP for sending m_open = mailopen("mailserver.company.com","username","password","SMTP") if not m_open dialog box mailerror() return endif fromname = "info@lianja.com" tonames = "fred@lianja.com" ccnames = "" subject = "For your information" message = "email.htm" attachments = "" content = "text/html" sendmail(fromname,tonames,ccnames,subject,message,attachments,.F.,content) mailclose()