Sender (Email subroutine): Difference between revisions
Jump to navigation
Jump to search
m (Created page with "This method specifies the mail sender's e-mail address. The <var>Sender</var> arguments you provide are sent to the SMTP server in a "MAIL FROM" command, and they are also includ...") |
m (Created page with "This method specifies the mail sender's e-mail address. The <var>Sender</var> arguments you provide are sent to the SMTP server in a "MAIL FROM" command, and they are also includ...") |
||
Line 1: | Line 1: | ||
{{Template:Email:Sender subtitle}} | |||
This method specifies the mail sender's e-mail address. | This method specifies the mail sender's e-mail address. | ||
The <var>Sender</var> arguments you provide are | The <var>Sender</var> arguments you provide are | ||
Line 4: | Line 6: | ||
and they are also included in the | and they are also included in the | ||
e-mail content as the "From" mail header. | e-mail content as the "From" mail header. | ||
== | ==Syntax== | ||
{{Template:Email:Sender syntax}} | |||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
Line 20: | Line 20: | ||
with the mail sender. | with the mail sender. | ||
This nickname appears in the e-mail content as part of the | This nickname appears in the e-mail content as part of the | ||
“From:” mail header. | &ldquo;From:&rdquo; mail header. | ||
</td></tr></table> | </td></tr></table> | ||
==Usage | ==Usage notes== | ||
<ul> | <ul> | ||
<li>The sender's e-mail address is not a required header according to protocol, | <li>The sender's e-mail address is not a required header according to protocol, | ||
Line 45: | Line 45: | ||
[[SMTP Helper#E-mail with attachment|"E-mail with attachment"]]. | [[SMTP Helper#E-mail with attachment|"E-mail with attachment"]]. | ||
</ul> | </ul> | ||
==See also== | |||
{{Template:Email:Sender footer}} |
Revision as of 21:41, 5 July 2011
Mail sender email address (Email class)
This method specifies the mail sender's e-mail address.
The Sender arguments you provide are
sent to the SMTP server in a "MAIL FROM" command,
and they are also included in the
e-mail content as the "From" mail header.
Syntax
email:Sender( name, [nickname])
Syntax terms
A previously declared Email object. | |
name | The e-mail address of the sender. |
nickname | An optional string that contains a familiar name associated
with the mail sender. This nickname appears in the e-mail content as part of the “From:” mail header. |
Usage notes
- The sender's e-mail address is not a required header according to protocol,
It is not an error if you omit the Sender method
(or, the equivalent, if you include a Sender call that has a null address)
in your request.
However, if no Sender value is set, no
From:
header is included in the e-mail content unless you explicitly do so using the AddHeader method. In practice, SMTP servers typically want a validly formed sender e-mail address, and they reject e-mail if an included sender address value does not contain an at sign (@) and a domain name (a string ending with a period (.) followed by a domain suffix). Note: The actual existence of such an address is not validated; merely its form. A null address value is usually acceptable, however. - For Sender method examples, see "Basic e-mail" and "E-mail with attachment".