| Mail::Util(3) | User Contributed Perl Documentation | Mail::Util(3) |
Mail::Util - mail utility functions
use Mail::Util qw( ... );
This package provides several mail related utility functions. Any function required must by explicitly listed on the use line to be exported into the calling package.
WARNING: This method does not quote lines which accidentally also start with the message separator "From", so this implementation can be considered broken. See Mail::Box::Mbox
- Look for the MAILDOMAIN environment variable, which can be set from outside the program. This is by far the best way to configure the domain.
- Look for a sendmail.cf file and extract DH parameter
- Look for a smail config file and usr the first host defined in hostname(s)
- Try an SMTP connect (if Net::SMTP exists) first to mailhost then localhost
- Use value from Net::Domain::domainname (if Net::Domain exists)
WARNING: On modern machines, there is only one good way to provide information to this method: the first; always explicitly configure the MAILDOMAIN.
# everywhere else use Mail::Util 'maildomain'; print maildomain;
WARNING: When not supplied via the environment variable, <mailaddress> looks at various configuration files and other environmental data. Although this seems to be smart behavior, this is not predictable enough (IMHO) to be used. Please set the MAILADDRESS explicitly, and do not trust on the "automatic detection", even when that produces a correct address (on the moment)
# everywhere else use Mail::Util 'mailaddress'; print mailaddress; # since v2.10 mailaddress "me@example.com";
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 19:
- Unknown directive: =chapter
- Around line 23:
- Unknown directive: =chapter
- Around line 27:
- Unknown directive: =chapter
- Around line 33:
- Unknown directive: =chapter
- Around line 35:
- Unknown directive: =function
- Around line 39:
- Deleting unknown formatting code M<>
- Around line 75:
- Unknown directive: =function
- Around line 97:
- Unknown directive: =example
- Around line 174:
- Unknown directive: =function
- Around line 187:
- Unknown directive: =example
| 2026-10-26 | perl v5.44.0 |