FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
smtp_account.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** FougTools
3 ** Copyright Fougue (30 Mar. 2015)
4 ** contact@fougue.pro
5 **
6 ** This software is a computer program whose purpose is to provide utility
7 ** tools for the C++ language and the Qt toolkit.
8 **
9 ** This software is governed by the CeCILL-C license under French law and
10 ** abiding by the rules of distribution of free software. You can use,
11 ** modify and/ or redistribute the software under the terms of the CeCILL-C
12 ** license as circulated by CEA, CNRS and INRIA at the following URL
13 ** "http://www.cecill.info".
14 ****************************************************************************/
15 
16 #pragma once
17 
18 #include "network.h"
19 #include <QtCore/QString>
20 
21 namespace qtnetwork {
22 
24 {
25 public:
27  {
28  NoAuthentication, // Anonymous
31  CramMd5Authentication
32  };
33 
35  {
38  SslTlsSecurity
39  };
40 
41  SmtpAccount();
42 
43  QString host() const;
44  void setHost(const QString& name);
45 
46  int port() const;
47  void setPort(int p);
48 
49  AuthenticationMethod authenticationMethod() const;
50  void setAuthenticationMethod(AuthenticationMethod method);
51 
52  ConnectionSecurity connectionSecurity() const;
53  void setConnectionSecurity(ConnectionSecurity connSecurity);
54 
55  QString userName() const;
56  void setUserName(const QString& uname);
57 
58  QString password() const;
59  void setPassword(const QString& pwd);
60 
61  static AuthenticationMethod toAuthenticationMethod(int id, bool* ok = NULL);
62  static ConnectionSecurity toConnectionSecurity(int id, bool* ok = NULL);
63 
64 private:
65  QString m_host;
66  int m_port;
67  AuthenticationMethod m_authMethod;
68  ConnectionSecurity m_connSecurity;
69  QString m_userName;
70  QString m_password;
71 };
72 
73 } // namespace qtnetwork
Definition: smtp_account.h:28
Definition: smtp_account.h:37
AuthenticationMethod
Definition: smtp_account.h:26
Definition: smtp_account.h:29
Definition: smtp_account.h:36
ConnectionSecurity
Definition: smtp_account.h:34
Definition: smtp_account.h:30
Provides a convenient interface to define the user account to connect to a SMTP server.
Definition: smtp_account.h:23
#define QTTOOLS_NETWORK_EXPORT
Definition: network.h:27
Definition: mail_send.cpp:39