Dependents:   TimeZoneDemo EthernetJackTestCode MMEx_Challenge ntp_mem ... more

Committer:
segundo
Date:
Wed Dec 15 18:01:30 2010 +0000
Revision:
7:4e2468d7d5cb
Parent:
5:fa27dde97304

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
segundo 5:fa27dde97304 1
segundo 5:fa27dde97304 2 /*
segundo 5:fa27dde97304 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com) y Segundo Equipo
segundo 5:fa27dde97304 4
segundo 5:fa27dde97304 5 Permission is hereby granted, free of charge, to any person obtaining a copy
segundo 5:fa27dde97304 6 of this software and associated documentation files (the "Software"), to deal
segundo 5:fa27dde97304 7 in the Software without restriction, including without limitation the rights
segundo 5:fa27dde97304 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
segundo 5:fa27dde97304 9 copies of the Software, and to permit persons to whom the Software is
segundo 5:fa27dde97304 10 furnished to do so, subject to the following conditions:
segundo 5:fa27dde97304 11
segundo 5:fa27dde97304 12 The above copyright notice and this permission notice shall be included in
segundo 5:fa27dde97304 13 all copies or substantial portions of the Software.
segundo 5:fa27dde97304 14
segundo 5:fa27dde97304 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
segundo 5:fa27dde97304 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
segundo 5:fa27dde97304 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
segundo 5:fa27dde97304 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
segundo 5:fa27dde97304 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
segundo 5:fa27dde97304 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
segundo 5:fa27dde97304 21 THE SOFTWARE.
segundo 5:fa27dde97304 22 */
segundo 5:fa27dde97304 23
segundo 5:fa27dde97304 24 /** \file
segundo 5:fa27dde97304 25 Email message header file
segundo 5:fa27dde97304 26 */
segundo 5:fa27dde97304 27
segundo 5:fa27dde97304 28 #ifndef EMAIL_MESSAGE_H
segundo 5:fa27dde97304 29 #define EMAIL_MESSAGE_H
segundo 5:fa27dde97304 30
segundo 5:fa27dde97304 31 #include <vector>
segundo 5:fa27dde97304 32 using std::vector;
segundo 5:fa27dde97304 33
segundo 5:fa27dde97304 34 #include <string>
segundo 5:fa27dde97304 35 using std::string;
segundo 5:fa27dde97304 36
segundo 5:fa27dde97304 37 ///A simple email message
segundo 5:fa27dde97304 38 /**
segundo 5:fa27dde97304 39 A class to hold the message addresses and content for sending (with SMTPClient).
segundo 5:fa27dde97304 40 */
segundo 5:fa27dde97304 41 class EmailMessage {
segundo 5:fa27dde97304 42 public:
segundo 5:fa27dde97304 43 ///Instantiates the email message
segundo 5:fa27dde97304 44 EmailMessage();
segundo 5:fa27dde97304 45
segundo 5:fa27dde97304 46 ///Destructor for the email message
segundo 5:fa27dde97304 47 ~EmailMessage();
segundo 5:fa27dde97304 48
segundo 5:fa27dde97304 49 ///Set FROM address
segundo 5:fa27dde97304 50 /**
segundo 5:fa27dde97304 51 @param from : email from address
segundo 5:fa27dde97304 52 */
segundo 5:fa27dde97304 53 void setFrom(const char* from);
segundo 5:fa27dde97304 54
segundo 5:fa27dde97304 55 ///Add TO address to list of recipient addresses
segundo 5:fa27dde97304 56 /**
segundo 5:fa27dde97304 57 @param host : SMTP server host
segundo 5:fa27dde97304 58 */
segundo 5:fa27dde97304 59 void addTo(const char* to);
segundo 5:fa27dde97304 60
segundo 5:fa27dde97304 61 ///Clear TO addresses
segundo 5:fa27dde97304 62 void clearTo();
segundo 5:fa27dde97304 63
segundo 5:fa27dde97304 64 ///Append text to content of message using printf
segundo 5:fa27dde97304 65 /**
segundo 5:fa27dde97304 66 @param format : printf format followed by ... variables
segundo 5:fa27dde97304 67
segundo 5:fa27dde97304 68 Can be called multiple times to write the message
segundo 5:fa27dde97304 69 */
segundo 5:fa27dde97304 70 int printf(const char* format, ... );
segundo 5:fa27dde97304 71
segundo 5:fa27dde97304 72 ///Clear content previously appended by printf
segundo 5:fa27dde97304 73 void clearContent();
segundo 5:fa27dde97304 74
segundo 5:fa27dde97304 75 private:
segundo 5:fa27dde97304 76 friend class SMTPClient;
segundo 5:fa27dde97304 77 string m_from;
segundo 5:fa27dde97304 78 vector<string> m_lTo;
segundo 5:fa27dde97304 79 string m_content;
segundo 5:fa27dde97304 80
segundo 5:fa27dde97304 81 };
segundo 5:fa27dde97304 82
segundo 5:fa27dde97304 83 #endif