<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"/> <title>mail::emailAddress</title> <link rel="stylesheet" href="manpage.css" type="text/css"/> <link rel="start" href="index.html" title="Cone: COnsole Newsreader And Emailer"/> <link rel="up" href="misc.html" title="Extra/Miscellaneous objects/methods"/> <link rel="prev" href="mail-attachments.html" title="mail::Attachment"/> <link rel="next" href="envelope.html" title="mail::envelope"/> <link xmlns="" rel="icon" href="icon.gif" type="image/gif"/> <meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/> <!-- Copyright 2002 - 2007 Double Precision, Inc. See COPYING for distribution information. --> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center" rowspan="1"> mail::emailAddress</th> </tr> <tr> <td width="20%" align="left" rowspan="1" colspan="1"> <a accesskey="p" href="mail-attachments.html" shape="rect">Prev</a> </td> <th width="60%" align="center" rowspan="1" colspan="1"> Extra/Miscellaneous objects/methods</th> <td width="20%" align="right" rowspan="1" colspan="1">  <a accesskey="n" href="envelope.html" shape="rect">Next</a></td> </tr> </table> <hr/> </div> <div class="refentry" lang="en" xml:lang="en"> <a id="emailaddress" shape="rect" name="emailaddress"> </a> <div class="titlepage"/> <div class="refnamediv"> <h2>Name</h2> <p>mail::emailAddress — An E-mail address</p> </div> <div class="refsynopsisdiv"> <h2>Synopsis</h2> <div class="literallayout"> <p><br clear="none"/> #include <libmail/rfcaddr.H><br clear="none"/> <br clear="none"/> mail::emailAddress address("Jóse Smith", "josesmith@example.com");<br clear="none"/> <br clear="none"/> std::string addr=address.getAddr();<br clear="none"/> std::string name=address.getAddrName();<br clear="none"/> <br clear="none"/> address.setAddr(addr);<br clear="none"/> address.setAddrName(name);<br clear="none"/> <br clear="none"/></p> </div> </div> <div class="refsect1" lang="en" xml:lang="en"> <a id="id641852" shape="rect" name="id641852"> </a> <h2>USAGE</h2> <p><span class="structname">mail::emailAddress</span> is a subclass of <span class="structname">mail::address</span> that defines two new methods: <code class="function">getAddrName()</code>, <code class="function">setAddrName()</code>, which retrieve or set the name component of an E-mail address using the native character set. For most purposes, using <span class="structname">mail::emailAddress</span> is preferrable to using <span class="structname">mail::address</span>. <span class="structname">mail::address</span>'s <code class="function">getName()</code> and <code class="function">setName()</code> methods deal with the raw, MIME-encoded format of E-mail address names (see <a class="ulink" href="http://www.rfc-editor.org/rfc/rfc2047.txt" target="_top" shape="rect">RFC 2047</a>).</p> <p>Convert a native name to its MIME-encoded format by using <code class="function">setAddrName()</code> followed by <code class="function">getName()</code>. Similarly, decoded a MIME-encoded name by using <code class="function">setName()</code> followed by <code class="function">getAddrName()</code>.</p> <p>The <code class="function">toString</code> and <code class="function">fromString</code> methods are templates, and may be used with a vector of <span class="structname">mail::emailAddress</span> or <span class="structname">mail::address</span> objects. The two classes are completely interchangable. A <span class="structname">mail::emailAddress</span> object may be assigned or converted to a <span class="structname">mail::address</span>, and vice-versa.</p> </div> <div class="refsect1" lang="en" xml:lang="en"> <a id="id641970" shape="rect" name="id641970"> </a> <h2>SEE ALSO</h2> <p><a class="link" href="address.html" title="mail::address" shape="rect"><span class="citerefentry"><span class="refentrytitle">mail::address</span>(3x)</span></a>, <a class="link" href="mail-setappcharset.html" title="mail::setAppCharset" shape="rect"><span class="citerefentry"><span class="refentrytitle">mail::setappcharset</span>(3x)</span></a>.</p> </div> </div> <div class="navfooter"> <hr/> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left" rowspan="1" colspan="1"> <a accesskey="p" href="mail-attachments.html" shape="rect">Prev</a> </td> <td width="20%" align="center" rowspan="1" colspan="1"> <a accesskey="u" href="misc.html" shape="rect">Up</a></td> <td width="40%" align="right" rowspan="1" colspan="1">  <a accesskey="n" href="envelope.html" shape="rect">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top" rowspan="1" colspan="1">mail::Attachment </td> <td width="20%" align="center" rowspan="1" colspan="1"> <a accesskey="h" href="index.html" shape="rect">Home</a> | <a accesskey="t" href="bk01-toc.html" shape="rect">ToC</a></td> <td width="40%" align="right" valign="top" rowspan="1" colspan="1"> mail::envelope</td> </tr> </table> </div> </body> </html>