├── README.md ├── assets ├── css │ ├── bootstrap.min.css │ ├── style-v2.css │ ├── style-v3.css │ ├── style-v4.css │ ├── style-v5.css │ ├── style-v6.css │ ├── style-v7.css │ ├── style-v8.css │ └── style.css ├── font-awesome │ ├── css │ │ └── font-awesome.min.css │ └── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 ├── img │ └── launcher-loader.gif ├── js │ ├── app.js │ ├── bootstrap.min.js │ ├── jquery-2.1.1.js │ ├── jquery.validate.min.js │ └── less.min.js └── less │ ├── style-v2.less │ ├── style-v3.less │ ├── style-v4.less │ ├── style-v5.less │ ├── style-v6.less │ └── style.less ├── config.php ├── database.php ├── database └── information.sql ├── document.txt ├── index-dev.php ├── index.php ├── sendmail.php ├── uploads ├── .gitignore ├── .htaccess └── index.html └── vendor ├── autoload.php ├── composer ├── ClassLoader.php ├── LICENSE ├── autoload_classmap.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php └── installed.json └── phpmailer └── phpmailer ├── LICENSE ├── PHPMailerAutoload.php ├── VERSION ├── class.phpmailer.php ├── class.phpmaileroauth.php ├── class.phpmaileroauthgoogle.php ├── class.pop3.php ├── class.smtp.php ├── composer.json ├── composer.lock ├── examples ├── DKIM.phps ├── code_generator.phps ├── contactform.phps ├── contents.html ├── contentsutf8.html ├── exceptions.phps ├── gmail.phps ├── gmail_xoauth.phps ├── images │ ├── phpmailer.png │ └── phpmailer_mini.png ├── index.html ├── mail.phps ├── mailing_list.phps ├── pop_before_smtp.phps ├── scripts │ ├── XRegExp.js │ ├── shAutoloader.js │ ├── shBrushPhp.js │ ├── shCore.js │ └── shLegacy.js ├── send_file_upload.phps ├── send_multiple_file_upload.phps ├── sendmail.phps ├── signed-mail.phps ├── smtp.phps ├── smtp_check.phps ├── smtp_no_auth.phps ├── ssl_options.phps └── styles │ ├── shCore.css │ ├── shCoreDefault.css │ ├── shCoreDjango.css │ ├── shCoreEclipse.css │ ├── shCoreEmacs.css │ ├── shCoreFadeToGrey.css │ ├── shCoreMDUltra.css │ ├── shCoreMidnight.css │ ├── shCoreRDark.css │ ├── shThemeAppleScript.css │ ├── shThemeDefault.css │ ├── shThemeDjango.css │ ├── shThemeEclipse.css │ ├── shThemeEmacs.css │ ├── shThemeFadeToGrey.css │ ├── shThemeMDUltra.css │ ├── shThemeMidnight.css │ ├── shThemeRDark.css │ ├── shThemeVisualStudio.css │ └── wrapping.png ├── extras ├── EasyPeasyICS.php ├── README.md ├── htmlfilter.php └── ntlm_sasl_client.php ├── get_oauth_token.php └── language ├── phpmailer.lang-am.php ├── phpmailer.lang-ar.php ├── phpmailer.lang-az.php ├── phpmailer.lang-be.php ├── phpmailer.lang-bg.php ├── phpmailer.lang-ca.php ├── phpmailer.lang-ch.php ├── phpmailer.lang-cs.php ├── phpmailer.lang-da.php ├── phpmailer.lang-de.php ├── phpmailer.lang-el.php ├── phpmailer.lang-eo.php ├── phpmailer.lang-es.php ├── phpmailer.lang-et.php ├── phpmailer.lang-fa.php ├── phpmailer.lang-fi.php ├── phpmailer.lang-fo.php ├── phpmailer.lang-fr.php ├── phpmailer.lang-gl.php ├── phpmailer.lang-he.php ├── phpmailer.lang-hr.php ├── phpmailer.lang-hu.php ├── phpmailer.lang-id.php ├── phpmailer.lang-it.php ├── phpmailer.lang-ja.php ├── phpmailer.lang-ka.php ├── phpmailer.lang-ko.php ├── phpmailer.lang-lt.php ├── phpmailer.lang-lv.php ├── phpmailer.lang-ms.php ├── phpmailer.lang-nb.php ├── phpmailer.lang-nl.php ├── phpmailer.lang-pl.php ├── phpmailer.lang-pt.php ├── phpmailer.lang-pt_br.php ├── phpmailer.lang-ro.php ├── phpmailer.lang-ru.php ├── phpmailer.lang-sk.php ├── phpmailer.lang-sl.php ├── phpmailer.lang-sr.php ├── phpmailer.lang-sv.php ├── phpmailer.lang-tr.php ├── phpmailer.lang-uk.php ├── phpmailer.lang-vi.php ├── phpmailer.lang-zh.php └── phpmailer.lang-zh_cn.php /README.md: -------------------------------------------------------------------------------- 1 | # ajax_contact_form_php_and_send_mail 2 | ajax_contact_form_php_and_send_mail 3 | This is email sending example. -------------------------------------------------------------------------------- /assets/css/style-v2.css: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | } 6 | .wrap-form .form-contact { 7 | max-width: 100%; 8 | background: #98D4F3; 9 | border-radius: 0; 10 | border: 0; 11 | padding: 30px; 12 | } 13 | .wrap-form .form-contact .form-legend { 14 | display: none; 15 | } 16 | .wrap-form .form-contact .form-block { 17 | margin: 10px 0; 18 | } 19 | .wrap-form .form-contact .form-block .tag-label { 20 | box-sizing: border-box; 21 | float: none; 22 | width: 100%; 23 | color: #fff; 24 | font-weight: bold; 25 | font-size: 20px; 26 | padding: 0 0 0px 20px; 27 | } 28 | .wrap-form .form-contact .form-block .wrap-form-control { 29 | float: none; 30 | width: 100%; 31 | padding: 0; 32 | box-sizing: border-box; 33 | } 34 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input { 35 | width: 100%; 36 | padding: 5px 20px; 37 | box-sizing: border-box; 38 | background: #fff; 39 | font-size: 20px; 40 | border-radius: 15px; 41 | border: 0; 42 | } 43 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input:focus { 44 | outline: 0; 45 | border: 2px solid #72B2F8; 46 | } 47 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] { 48 | display: none; 49 | } 50 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label { 51 | padding: 0px 30px 10px 30px; 52 | position: relative; 53 | } 54 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:before { 55 | content: ""; 56 | width: 25px; 57 | height: 25px; 58 | border: 2px solid #fff; 59 | display: inline-block; 60 | border-radius: 50%; 61 | cursor: pointer; 62 | position: absolute; 63 | left: 0; 64 | z-index: 2; 65 | } 66 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:after { 67 | content: "\f00c"; 68 | font-family: FontAwesome; 69 | position: absolute; 70 | height: 23px; 71 | width: 23px; 72 | left: 1px; 73 | top: 1px; 74 | border-radius: 50%; 75 | display: none; 76 | background: #FF9900; 77 | text-align: center; 78 | line-height: 23px; 79 | color: #fff; 80 | font-weight: normal; 81 | } 82 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"]:checked + label:after { 83 | display: inline-block; 84 | } 85 | .wrap-form .form-contact .form-block .wrap-form-control .btn-warning { 86 | background: #FF9900; 87 | width: 100%; 88 | font-size: 20px; 89 | border-radius: 20px; 90 | } 91 | .wrap-form .form-contact .form-block .form-control-relative { 92 | position: relative; 93 | } 94 | .wrap-form .form-contact .form-block .form-control-relative #loading { 95 | position: absolute; 96 | top: 0; 97 | left: 90px; 98 | width: 40px; 99 | height: 40px; 100 | display: none; 101 | } 102 | .wrap-form .form-contact .form-block .form-control-relative #loading img { 103 | width: 100%; 104 | } 105 | .clr { 106 | clear: both; 107 | } 108 | .validate-error-class { 109 | color: #FF0000; 110 | /* red */ 111 | } 112 | /* responsive recaptcha */ 113 | @media(max-width: 480px){ 114 | .g-recaptcha iframe { 115 | max-width: 100%; 116 | transform:scale(0.77); 117 | -webkit-transform:scale(0.77); 118 | transform-origin: center center; 119 | -webkit-transform-origin: center center; 120 | } 121 | #rc-imageselect { 122 | transform:scale(0.77); 123 | -webkit-transform:scale(0.77); 124 | transform-origin:0 0; 125 | -webkit-transform-origin:0 0; 126 | } 127 | } -------------------------------------------------------------------------------- /assets/css/style-v3.css: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | } 6 | .wrap-form .form-contact { 7 | max-width: 100%; 8 | padding: 15px; 9 | background: #454F4F; 10 | border: 0; 11 | border-radius: 0; 12 | } 13 | .wrap-form .form-contact .form-legend { 14 | background: none; 15 | color: #fff; 16 | font-size: 20px; 17 | width: 100%; 18 | text-align: center; 19 | padding: 0; 20 | display: inline-block; 21 | margin-bottom: 20px; 22 | font-weight: bold; 23 | } 24 | .wrap-form .form-contact .form-block { 25 | margin: 10px 0; 26 | } 27 | .wrap-form .form-contact .form-block .tag-label { 28 | float: left; 29 | width: 30%; 30 | padding: 10px; 31 | box-sizing: border-box; 32 | font-weight: normal; 33 | text-align: right; 34 | color: white; 35 | } 36 | .wrap-form .form-contact .form-block .wrap-form-control { 37 | float: right; 38 | width: 70%; 39 | padding: 10px; 40 | box-sizing: border-box; 41 | } 42 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input { 43 | width: 100%; 44 | padding: 5px 10px; 45 | box-sizing: border-box; 46 | border: 0; 47 | background: #394141; 48 | color: #fff; 49 | border-radius: 5px; 50 | } 51 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] { 52 | display: none; 53 | } 54 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label { 55 | padding: 0px 30px 10px 30px; 56 | position: relative; 57 | } 58 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:before { 59 | content: ""; 60 | width: 25px; 61 | height: 25px; 62 | border: 2px solid #ccc; 63 | display: inline-block; 64 | border-radius: 50%; 65 | cursor: pointer; 66 | position: absolute; 67 | left: 0; 68 | z-index: 2; 69 | } 70 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:after { 71 | content: "\f00c"; 72 | font-family: FontAwesome; 73 | position: absolute; 74 | height: 23px; 75 | width: 23px; 76 | left: 1px; 77 | top: 1px; 78 | border-radius: 50%; 79 | display: none; 80 | background: #7BC087; 81 | text-align: center; 82 | line-height: 23px; 83 | color: #fff; 84 | font-weight: normal; 85 | } 86 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"]:checked + label:after { 87 | display: inline-block; 88 | } 89 | .wrap-form .form-contact .form-block .wrap-form-control .btn-warning { 90 | background: #7BC087; 91 | border: 0; 92 | } 93 | .wrap-form .form-contact .form-block .wrap-form-control .btn-warning:hover { 94 | background: #58B068; 95 | border: 0; 96 | } 97 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input-file { 98 | color: #fff; 99 | } 100 | .wrap-form .form-contact .form-block .wrap-form-control label { 101 | color: #fff; 102 | } 103 | .wrap-form .form-contact .form-block .form-control-relative { 104 | position: relative; 105 | } 106 | .wrap-form .form-contact .form-block .form-control-relative #loading { 107 | position: absolute; 108 | top: 0; 109 | left: 90px; 110 | width: 40px; 111 | height: 40px; 112 | display: none; 113 | } 114 | .wrap-form .form-contact .form-block .form-control-relative #loading img { 115 | width: 100%; 116 | } 117 | .clr { 118 | clear: both; 119 | } 120 | .validate-error-class { 121 | color: #FF0000; 122 | /* red */ 123 | } 124 | @media (min-width: 380px) and (max-width: 520px) { 125 | .wrap-form .form-contact .form-block .tag-label { 126 | float: none; 127 | text-align: left; 128 | } 129 | .wrap-form .form-contact .form-block .wrap-form-control { 130 | float: none; 131 | } 132 | } 133 | /* responsive recaptcha */ 134 | @media(max-width: 480px){ 135 | .g-recaptcha iframe { 136 | max-width: 100%; 137 | transform:scale(0.77); 138 | -webkit-transform:scale(0.77); 139 | transform-origin: center center; 140 | -webkit-transform-origin: center center; 141 | } 142 | #rc-imageselect { 143 | transform:scale(0.77); 144 | -webkit-transform:scale(0.77); 145 | transform-origin:0 0; 146 | -webkit-transform-origin:0 0; 147 | } 148 | } -------------------------------------------------------------------------------- /assets/css/style-v4.css: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | } 6 | .wrap-form .form-contact { 7 | max-width: 100%; 8 | background: #323232; 9 | border-radius: 0; 10 | border: 0; 11 | padding: 30px; 12 | } 13 | .wrap-form .form-contact .form-legend { 14 | color: #C0C0C0; 15 | font-size: 25px; 16 | font-weight: bold; 17 | } 18 | .wrap-form .form-contact .form-block { 19 | margin: 10px 0; 20 | } 21 | .wrap-form .form-contact .form-block .tag-label { 22 | box-sizing: border-box; 23 | float: none; 24 | width: 100%; 25 | color: #C0C0C0; 26 | font-weight: bold; 27 | font-size: 20px; 28 | padding: 0; 29 | } 30 | .wrap-form .form-contact .form-block .wrap-form-control { 31 | float: none; 32 | width: 100%; 33 | padding: 0; 34 | box-sizing: border-box; 35 | } 36 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input { 37 | width: 100%; 38 | padding: 5px 20px; 39 | box-sizing: border-box; 40 | background: #fff; 41 | font-size: 20px; 42 | border-radius: 5px; 43 | border: 0; 44 | } 45 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] { 46 | display: none; 47 | } 48 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label { 49 | padding: 0px 30px 10px 30px; 50 | position: relative; 51 | color: #C0C0C0; 52 | } 53 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:before { 54 | content: ""; 55 | width: 25px; 56 | height: 25px; 57 | border: 2px solid #fff; 58 | display: inline-block; 59 | border-radius: 50%; 60 | cursor: pointer; 61 | position: absolute; 62 | left: 0; 63 | z-index: 2; 64 | } 65 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:after { 66 | content: "\f00c"; 67 | font-family: FontAwesome; 68 | position: absolute; 69 | height: 23px; 70 | width: 23px; 71 | left: 1px; 72 | top: 1px; 73 | border-radius: 50%; 74 | display: none; 75 | background: #991D57; 76 | text-align: center; 77 | line-height: 23px; 78 | color: yellow; 79 | font-weight: normal; 80 | } 81 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"]:checked + label:after { 82 | display: inline-block; 83 | } 84 | .wrap-form .form-contact .form-block .wrap-form-control .btn-warning { 85 | width: 100%; 86 | font-size: 20px; 87 | background: #991D57; 88 | border: 0; 89 | border-radius: 5px; 90 | padding: 15px 0; 91 | color: #C0C0C0; 92 | } 93 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input-file { 94 | color: #C0C0C0; 95 | } 96 | .wrap-form .form-contact .form-block .form-control-relative { 97 | position: relative; 98 | } 99 | .wrap-form .form-contact .form-block .form-control-relative #loading { 100 | position: absolute; 101 | top: 0; 102 | left: 90px; 103 | width: 40px; 104 | height: 40px; 105 | display: none; 106 | } 107 | .wrap-form .form-contact .form-block .form-control-relative #loading img { 108 | width: 100%; 109 | } 110 | .clr { 111 | clear: both; 112 | } 113 | .validate-error-class { 114 | color: #FF0000; 115 | /* red */ 116 | } 117 | /* responsive recaptcha */ 118 | @media(max-width: 480px){ 119 | .g-recaptcha iframe { 120 | max-width: 100%; 121 | transform:scale(0.77); 122 | -webkit-transform:scale(0.77); 123 | transform-origin: center center; 124 | -webkit-transform-origin: center center; 125 | } 126 | #rc-imageselect { 127 | transform:scale(0.77); 128 | -webkit-transform:scale(0.77); 129 | transform-origin:0 0; 130 | -webkit-transform-origin:0 0; 131 | } 132 | } -------------------------------------------------------------------------------- /assets/css/style-v5.css: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | } 6 | .wrap-form .form-contact { 7 | max-width: 100%; 8 | background: #AA162C; 9 | border-bottom-left-radius: 10px; 10 | border-bottom-right-radius: 10px; 11 | border-radius: 0; 12 | border: 0; 13 | padding: 30px; 14 | } 15 | .wrap-form .form-contact .form-legend { 16 | color: #fff; 17 | font-size: 25px; 18 | font-weight: bold; 19 | } 20 | .wrap-form .form-contact .form-block { 21 | margin: 10px 0; 22 | } 23 | .wrap-form .form-contact .form-block .tag-label { 24 | box-sizing: border-box; 25 | float: none; 26 | width: 100%; 27 | color: #fff; 28 | font-weight: bold; 29 | font-size: 20px; 30 | padding: 0; 31 | } 32 | .wrap-form .form-contact .form-block .wrap-form-control { 33 | float: none; 34 | width: 100%; 35 | padding: 0; 36 | box-sizing: border-box; 37 | } 38 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input { 39 | width: 100%; 40 | padding: 5px 20px; 41 | box-sizing: border-box; 42 | background: #fff; 43 | font-size: 20px; 44 | border-radius: 0px; 45 | border: 0; 46 | } 47 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] { 48 | display: none; 49 | } 50 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label { 51 | padding: 0px 30px 10px 30px; 52 | position: relative; 53 | color: #fff; 54 | } 55 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:before { 56 | content: ""; 57 | width: 25px; 58 | height: 25px; 59 | border: 2px solid #fff; 60 | display: inline-block; 61 | border-radius: 50%; 62 | cursor: pointer; 63 | position: absolute; 64 | left: 0; 65 | z-index: 2; 66 | } 67 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:after { 68 | content: "\f00c"; 69 | font-family: FontAwesome; 70 | position: absolute; 71 | height: 23px; 72 | width: 23px; 73 | left: 1px; 74 | top: 1px; 75 | border-radius: 50%; 76 | display: none; 77 | background: #991D57; 78 | text-align: center; 79 | line-height: 23px; 80 | color: yellow; 81 | font-weight: normal; 82 | } 83 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"]:checked + label:after { 84 | display: inline-block; 85 | } 86 | .wrap-form .form-contact .form-block .wrap-form-control .btn-warning { 87 | font-size: 20px; 88 | background: #CCCCCC; 89 | border: 0; 90 | border-radius: 20px; 91 | padding: 5px 10px; 92 | color: #000; 93 | } 94 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input-file { 95 | color: #fff; 96 | } 97 | .wrap-form .form-contact .form-block .form-control-relative { 98 | position: relative; 99 | } 100 | .wrap-form .form-contact .form-block .form-control-relative #loading { 101 | position: absolute; 102 | top: 0; 103 | left: 90px; 104 | width: 40px; 105 | height: 40px; 106 | display: none; 107 | } 108 | .wrap-form .form-contact .form-block .form-control-relative #loading img { 109 | width: 100%; 110 | } 111 | .clr { 112 | clear: both; 113 | } 114 | .validate-error-class { 115 | color: #FF0000; 116 | /* red */ 117 | } 118 | /* responsive recaptcha */ 119 | @media(max-width: 480px){ 120 | .g-recaptcha iframe { 121 | max-width: 100%; 122 | transform:scale(0.77); 123 | -webkit-transform:scale(0.77); 124 | transform-origin: center center; 125 | -webkit-transform-origin: center center; 126 | } 127 | #rc-imageselect { 128 | transform:scale(0.77); 129 | -webkit-transform:scale(0.77); 130 | transform-origin:0 0; 131 | -webkit-transform-origin:0 0; 132 | } 133 | } -------------------------------------------------------------------------------- /assets/css/style-v6.css: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | } 6 | .wrap-form .form-contact { 7 | max-width: 100%; 8 | background: #FB540D; 9 | border-bottom-left-radius: 10px; 10 | border-bottom-right-radius: 10px; 11 | border-radius: 0; 12 | border: 0; 13 | padding: 30px; 14 | } 15 | .wrap-form .form-contact .form-legend { 16 | color: #fff; 17 | font-size: 25px; 18 | font-weight: bold; 19 | width: 100%; 20 | text-align: center; 21 | display: inline-block; 22 | } 23 | .wrap-form .form-contact .form-block { 24 | margin: 10px 0; 25 | } 26 | .wrap-form .form-contact .form-block .tag-label { 27 | box-sizing: border-box; 28 | float: none; 29 | width: 100%; 30 | color: #fff; 31 | font-weight: bold; 32 | font-size: 20px; 33 | padding: 0; 34 | text-align: center; 35 | } 36 | .wrap-form .form-contact .form-block .wrap-form-control { 37 | float: none; 38 | width: 100%; 39 | padding: 0; 40 | box-sizing: border-box; 41 | text-align: center; 42 | } 43 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input { 44 | width: 100%; 45 | padding: 5px 20px; 46 | box-sizing: border-box; 47 | background: #fff; 48 | font-size: 20px; 49 | border-radius: 0px; 50 | border: 0; 51 | text-align: center; 52 | } 53 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] { 54 | display: none; 55 | } 56 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label { 57 | padding: 0px 30px 10px 30px; 58 | position: relative; 59 | color: #fff; 60 | } 61 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:before { 62 | content: ""; 63 | width: 25px; 64 | height: 25px; 65 | border: 2px solid #fff; 66 | display: inline-block; 67 | border-radius: 50%; 68 | cursor: pointer; 69 | position: absolute; 70 | left: 0; 71 | z-index: 2; 72 | } 73 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:after { 74 | content: "\f00c"; 75 | font-family: FontAwesome; 76 | position: absolute; 77 | height: 23px; 78 | width: 23px; 79 | left: 1px; 80 | top: 1px; 81 | border-radius: 50%; 82 | display: none; 83 | background: #991D57; 84 | text-align: center; 85 | line-height: 23px; 86 | color: yellow; 87 | font-weight: normal; 88 | } 89 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"]:checked + label:after { 90 | display: inline-block; 91 | } 92 | .wrap-form .form-contact .form-block .wrap-form-control .btn-warning { 93 | font-size: 20px; 94 | border-radius: 20px; 95 | padding: 5px 10px; 96 | width: 100%; 97 | background: none; 98 | border: 2px solid #fff; 99 | color: #fff; 100 | text-transform: uppercase; 101 | font-weight: bold; 102 | } 103 | .wrap-form .form-contact .form-block .wrap-form-control .btn-warning:hover { 104 | background: blueviolet; 105 | } 106 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input-file { 107 | color: #fff; 108 | margin: 0 auto; 109 | } 110 | .wrap-form .form-contact .form-block .wrap-form-control .g-recaptcha > div { 111 | margin: 0 auto; 112 | } 113 | .wrap-form .form-contact .form-block .form-control-relative { 114 | position: relative; 115 | } 116 | .wrap-form .form-contact .form-block .form-control-relative #loading { 117 | position: absolute; 118 | top: 0; 119 | left: 90px; 120 | width: 40px; 121 | height: 40px; 122 | display: none; 123 | } 124 | .wrap-form .form-contact .form-block .form-control-relative #loading img { 125 | width: 100%; 126 | } 127 | .clr { 128 | clear: both; 129 | } 130 | .validate-error-class { 131 | color: #FF0000; 132 | /* red */ 133 | } 134 | /* responsive recaptcha */ 135 | @media(max-width: 480px){ 136 | .g-recaptcha iframe { 137 | max-width: 100%; 138 | transform:scale(0.77); 139 | -webkit-transform:scale(0.77); 140 | transform-origin: center center; 141 | -webkit-transform-origin: center center; 142 | } 143 | #rc-imageselect { 144 | transform:scale(0.77); 145 | -webkit-transform:scale(0.77); 146 | transform-origin:0 0; 147 | -webkit-transform-origin:0 0; 148 | } 149 | } -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 30px auto; 5 | } 6 | .wrap-form .form-contact { 7 | max-width: 100%; 8 | background: #fff; 9 | padding: 15px; 10 | border: 1px solid #ccc; 11 | border-radius: 10px; 12 | position: relative; 13 | } 14 | .wrap-form .form-contact .form-legend { 15 | position: absolute; 16 | top: -11px; 17 | left: 30px; 18 | background: #fff; 19 | padding: 0 5px; 20 | color: #666; 21 | font-weight: bold; 22 | } 23 | .wrap-form .form-contact .form-block { 24 | margin: 10px 0; 25 | } 26 | .wrap-form .form-contact .form-block .tag-label { 27 | float: left; 28 | width: 30%; 29 | padding: 10px; 30 | box-sizing: border-box; 31 | font-weight: normal; 32 | color: #666; 33 | } 34 | .wrap-form .form-contact .form-block .wrap-form-control { 35 | float: right; 36 | width: 70%; 37 | padding: 10px; 38 | box-sizing: border-box; 39 | } 40 | .wrap-form .form-contact .form-block .wrap-form-control .tag-input { 41 | width: 100%; 42 | padding: 5px 10px; 43 | box-sizing: border-box; 44 | background: none; 45 | border: 1px solid #ccc; 46 | border-radius: 5px; 47 | } 48 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] { 49 | display: none; 50 | } 51 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label { 52 | padding: 0px 30px 10px 30px; 53 | position: relative; 54 | } 55 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:before { 56 | content: ""; 57 | width: 25px; 58 | height: 25px; 59 | border: 2px solid #ccc; 60 | display: inline-block; 61 | border-radius: 50%; 62 | cursor: pointer; 63 | position: absolute; 64 | left: 0; 65 | z-index: 2; 66 | } 67 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"] + label:after { 68 | content: "\f00c"; 69 | font-family: FontAwesome; 70 | position: absolute; 71 | height: 23px; 72 | width: 23px; 73 | left: 1px; 74 | top: 1px; 75 | border-radius: 50%; 76 | display: none; 77 | background: #ec971f; 78 | text-align: center; 79 | line-height: 23px; 80 | color: #fff; 81 | font-weight: normal; 82 | } 83 | .wrap-form .form-contact .form-block .wrap-form-control input[type="radio"]:checked + label:after { 84 | display: inline-block; 85 | } 86 | .wrap-form .form-contact .form-block .form-control-relative { 87 | position: relative; 88 | } 89 | .wrap-form .form-contact .form-block .form-control-relative #loading { 90 | position: absolute; 91 | top: 0; 92 | left: 90px; 93 | width: 40px; 94 | height: 40px; 95 | display: none; 96 | } 97 | .wrap-form .form-contact .form-block .form-control-relative #loading img { 98 | width: 100%; 99 | } 100 | .clr { 101 | clear: both; 102 | } 103 | .validate-error-class { 104 | color: #FF0000; 105 | /* red */ 106 | } 107 | @media(max-width: 520px) { 108 | .wrap-form .form-contact .form-block .tag-label { 109 | float: none; 110 | padding: 0 5px; 111 | font-weight: bold; 112 | } 113 | 114 | .wrap-form .form-contact .form-block .wrap-form-control { 115 | float: none; 116 | width: 100%; 117 | padding: 0 5px; 118 | } 119 | .wrap-form .form-contact .form-block.submit-wrapper{ 120 | margin-top: 0; 121 | } 122 | .wrap-form .form-contact .form-block.submit-wrapper button{ 123 | width: 100%; 124 | } 125 | } 126 | 127 | /* responsive recaptcha */ 128 | @media(max-width: 480px){ 129 | .g-recaptcha iframe { 130 | max-width: 100%; 131 | transform:scale(0.77); 132 | -webkit-transform:scale(0.77); 133 | transform-origin: center center; 134 | -webkit-transform-origin: center center; 135 | } 136 | #rc-imageselect { 137 | transform:scale(0.77); 138 | -webkit-transform:scale(0.77); 139 | transform-origin:0 0; 140 | -webkit-transform-origin:0 0; 141 | } 142 | } -------------------------------------------------------------------------------- /assets/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/assets/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /assets/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/assets/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /assets/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/assets/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /assets/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/assets/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /assets/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/assets/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /assets/img/launcher-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/assets/img/launcher-loader.gif -------------------------------------------------------------------------------- /assets/js/app.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | var valid = false; 3 | $("#form-contact").validate({ 4 | ignore: ".ignore", 5 | rules: { 6 | email: { 7 | required: true, 8 | email: true 9 | }, 10 | message: { 11 | required: true 12 | }, 13 | hiddenRecaptcha: { 14 | required: function () { 15 | if (grecaptcha.getResponse() == '') { 16 | return true; 17 | } else { 18 | return false; 19 | } 20 | } 21 | } 22 | }, 23 | invalidHandler: function (event, validator) { 24 | valid = false; 25 | }, 26 | submitHandler: function () { 27 | valid = true; 28 | }, 29 | errorClass: "validate-error-class", 30 | validClass: "validate-class" 31 | }); 32 | $("#form-contact").submit(function (e) { 33 | e.preventDefault(); 34 | if (valid == true) { 35 | $('#loading').show(); 36 | var formData = new FormData($(this)[0]); 37 | $.ajax({ 38 | url: 'sendmail.php', 39 | type: 'POST', 40 | data: formData, 41 | dataType: "json", 42 | // async: false, 43 | success: function (data) { 44 | if (data.result) { 45 | $("#form-contact input").val(""); 46 | $("#form-contact textarea").val(""); 47 | } 48 | grecaptcha.reset(); 49 | $('#loading').hide(); 50 | $("#my_id").click(); 51 | $(".mail-result p").html(data.message); 52 | 53 | }, 54 | cache: false, 55 | contentType: false, 56 | processData: false 57 | }); 58 | 59 | return false; 60 | } 61 | }); 62 | }); -------------------------------------------------------------------------------- /assets/less/style-v2.less: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | .form-contact { 6 | max-width: 100%; 7 | background: #98D4F3; 8 | border-radius: 0; 9 | border: 0; 10 | padding: 30px; 11 | .form-legend { 12 | display: none; 13 | } 14 | .form-block { 15 | margin: 10px 0; 16 | .tag-label { 17 | box-sizing: border-box; 18 | float: none; 19 | width: 100%; 20 | color: #fff; 21 | font-weight: bold; 22 | font-size: 20px; 23 | padding: 0 0 0px 20px; 24 | } 25 | .wrap-form-control { 26 | float: none; 27 | width: 100%; 28 | padding: 0; 29 | box-sizing: border-box; 30 | .tag-input { 31 | width: 100%; 32 | padding: 5px 20px; 33 | box-sizing: border-box; 34 | background: #fff; 35 | font-size: 20px; 36 | border-radius: 15px; 37 | border: 0; 38 | &:focus { 39 | outline: 0; 40 | border: 2px solid #72B2F8; 41 | } 42 | } 43 | input[type="radio"] { 44 | display:none; 45 | } 46 | input[type="radio"] + label { 47 | padding: 0px 30px 10px 30px; 48 | position: relative; 49 | } 50 | input[type="radio"] + label:before { 51 | content: ""; 52 | width: 25px; 53 | height: 25px; 54 | border: 2px solid #fff; 55 | display: inline-block; 56 | border-radius: 50%; 57 | cursor: pointer; 58 | position: absolute; 59 | left: 0; 60 | z-index: 2; 61 | } 62 | input[type="radio"] + label:after { 63 | content: "\f00c"; 64 | font-family: FontAwesome; 65 | position: absolute; 66 | height: 23px; 67 | width: 23px; 68 | left: 1px; 69 | top: 1px; 70 | border-radius: 50%; 71 | display: none; 72 | background: #FF9900; 73 | text-align: center; 74 | line-height: 23px; 75 | color: #fff; 76 | font-weight: normal; 77 | } 78 | input[type="radio"]:checked + label:after { 79 | display: inline-block; 80 | } 81 | .btn-warning { 82 | background: #FF9900; 83 | width: 100%; 84 | font-size: 20px; 85 | border-radius: 20px; 86 | } 87 | } 88 | .form-control-relative { 89 | position: relative; 90 | #loading { 91 | position: absolute; 92 | top: 0; 93 | left: 90px; 94 | width: 40px; 95 | height: 40px; 96 | display: none; 97 | img { 98 | width: 100%; 99 | } 100 | } 101 | } 102 | } 103 | } 104 | } 105 | .clr { 106 | clear: both; 107 | } 108 | .validate-error-class { 109 | color:#FF0000; /* red */ 110 | } -------------------------------------------------------------------------------- /assets/less/style-v3.less: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | .form-contact { 6 | max-width: 100%; 7 | padding: 15px; 8 | background: #454F4F; 9 | border: 0; 10 | border-radius: 0; 11 | .form-legend { 12 | background: none; 13 | color: #fff; 14 | font-size: 20px; 15 | width: 100%; 16 | text-align: center; 17 | padding: 0; 18 | display: inline-block; 19 | margin-bottom: 20px; 20 | font-weight: bold; 21 | } 22 | .form-block { 23 | margin: 10px 0; 24 | .tag-label { 25 | float: left; 26 | width: 30%; 27 | padding: 10px; 28 | box-sizing: border-box; 29 | font-weight: normal; 30 | text-align: right; 31 | color: white; 32 | } 33 | .wrap-form-control { 34 | float: right; 35 | width: 70%; 36 | padding: 10px; 37 | box-sizing: border-box; 38 | .tag-input { 39 | width: 100%; 40 | padding: 5px 10px; 41 | box-sizing: border-box; 42 | border: 0; 43 | background: #394141; 44 | color: #fff; 45 | border-radius: 5px; 46 | } 47 | input[type="radio"] { 48 | display:none; 49 | } 50 | input[type="radio"] + label { 51 | padding: 0px 30px 10px 30px; 52 | position: relative; 53 | } 54 | input[type="radio"] + label:before { 55 | content: ""; 56 | width: 25px; 57 | height: 25px; 58 | border: 2px solid #ccc; 59 | display: inline-block; 60 | border-radius: 50%; 61 | cursor: pointer; 62 | position: absolute; 63 | left: 0; 64 | z-index: 2; 65 | } 66 | input[type="radio"] + label:after { 67 | content: "\f00c"; 68 | font-family: FontAwesome; 69 | position: absolute; 70 | height: 23px; 71 | width: 23px; 72 | left: 1px; 73 | top: 1px; 74 | border-radius: 50%; 75 | display: none; 76 | background: #7BC087; 77 | text-align: center; 78 | line-height: 23px; 79 | color: #fff; 80 | font-weight: normal; 81 | } 82 | input[type="radio"]:checked + label:after { 83 | display: inline-block; 84 | } 85 | .btn-warning { 86 | background: #7BC087; 87 | border: 0; 88 | } 89 | .btn-warning:hover { 90 | background: #58B068; 91 | border: 0; 92 | } 93 | .tag-input-file { 94 | color: #fff; 95 | } 96 | label { 97 | color: #fff; 98 | } 99 | } 100 | .form-control-relative { 101 | position: relative; 102 | #loading { 103 | position: absolute; 104 | top: 0; 105 | left: 90px; 106 | width: 40px; 107 | height: 40px; 108 | display: none; 109 | img { 110 | width: 100%; 111 | } 112 | } 113 | } 114 | } 115 | } 116 | } 117 | .clr { 118 | clear: both; 119 | } 120 | .validate-error-class { 121 | color:#FF0000; /* red */ 122 | } 123 | @media (min-width:380px) and (max-width:520px) { 124 | .wrap-form { 125 | .form-contact { 126 | .form-block { 127 | .tag-label { 128 | float: none; 129 | text-align: left; 130 | } 131 | .wrap-form-control { 132 | float: none; 133 | } 134 | } 135 | } 136 | } 137 | } -------------------------------------------------------------------------------- /assets/less/style-v4.less: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | .form-contact { 6 | max-width: 100%; 7 | background: #323232; 8 | border-radius: 0; 9 | border: 0; 10 | padding: 30px; 11 | .form-legend { 12 | color: #C0C0C0; 13 | font-size: 25px; 14 | font-weight: bold; 15 | } 16 | .form-block { 17 | margin: 10px 0; 18 | .tag-label { 19 | box-sizing: border-box; 20 | float: none; 21 | width: 100%; 22 | color: #C0C0C0; 23 | font-weight: bold; 24 | font-size: 20px; 25 | padding: 0; 26 | } 27 | .wrap-form-control { 28 | float: none; 29 | width: 100%; 30 | padding: 0; 31 | box-sizing: border-box; 32 | .tag-input { 33 | width: 100%; 34 | padding: 5px 20px; 35 | box-sizing: border-box; 36 | background: #fff; 37 | font-size: 20px; 38 | border-radius: 5px; 39 | border: 0; 40 | } 41 | input[type="radio"] { 42 | display:none; 43 | } 44 | input[type="radio"] + label { 45 | padding: 0px 30px 10px 30px; 46 | position: relative; 47 | color: #C0C0C0; 48 | } 49 | input[type="radio"] + label:before { 50 | content: ""; 51 | width: 25px; 52 | height: 25px; 53 | border: 2px solid #fff; 54 | display: inline-block; 55 | border-radius: 50%; 56 | cursor: pointer; 57 | position: absolute; 58 | left: 0; 59 | z-index: 2; 60 | } 61 | input[type="radio"] + label:after { 62 | content: "\f00c"; 63 | font-family: FontAwesome; 64 | position: absolute; 65 | height: 23px; 66 | width: 23px; 67 | left: 1px; 68 | top: 1px; 69 | border-radius: 50%; 70 | display: none; 71 | background: #991D57; 72 | text-align: center; 73 | line-height: 23px; 74 | color: yellow; 75 | font-weight: normal; 76 | } 77 | input[type="radio"]:checked + label:after { 78 | display: inline-block; 79 | } 80 | .btn-warning { 81 | width: 100%; 82 | font-size: 20px; 83 | background: #991D57; 84 | border: 0; 85 | border-radius: 5px; 86 | padding: 15px 0; 87 | color: #C0C0C0; 88 | } 89 | .tag-input-file { 90 | color: #C0C0C0; 91 | } 92 | } 93 | .form-control-relative { 94 | position: relative; 95 | #loading { 96 | position: absolute; 97 | top: 0; 98 | left: 90px; 99 | width: 40px; 100 | height: 40px; 101 | display: none; 102 | img { 103 | width: 100%; 104 | } 105 | } 106 | } 107 | } 108 | } 109 | } 110 | .clr { 111 | clear: both; 112 | } 113 | .validate-error-class { 114 | color:#FF0000; /* red */ 115 | } -------------------------------------------------------------------------------- /assets/less/style-v5.less: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | .form-contact { 6 | max-width: 100%; 7 | background: #AA162C; 8 | border-bottom-left-radius: 10px; 9 | border-bottom-right-radius: 10px; 10 | border-radius: 0; 11 | border: 0; 12 | padding: 30px; 13 | .form-legend { 14 | color: #fff; 15 | font-size: 25px; 16 | font-weight: bold; 17 | } 18 | .form-block { 19 | margin: 10px 0; 20 | .tag-label { 21 | box-sizing: border-box; 22 | float: none; 23 | width: 100%; 24 | color: #fff; 25 | font-weight: bold; 26 | font-size: 20px; 27 | padding: 0; 28 | } 29 | .wrap-form-control { 30 | float: none; 31 | width: 100%; 32 | padding: 0; 33 | box-sizing: border-box; 34 | .tag-input { 35 | width: 100%; 36 | padding: 5px 20px; 37 | box-sizing: border-box; 38 | background: #fff; 39 | font-size: 20px; 40 | border-radius: 0px; 41 | border: 0; 42 | } 43 | input[type="radio"] { 44 | display:none; 45 | } 46 | input[type="radio"] + label { 47 | padding: 0px 30px 10px 30px; 48 | position: relative; 49 | color: #fff; 50 | } 51 | input[type="radio"] + label:before { 52 | content: ""; 53 | width: 25px; 54 | height: 25px; 55 | border: 2px solid #fff; 56 | display: inline-block; 57 | border-radius: 50%; 58 | cursor: pointer; 59 | position: absolute; 60 | left: 0; 61 | z-index: 2; 62 | } 63 | input[type="radio"] + label:after { 64 | content: "\f00c"; 65 | font-family: FontAwesome; 66 | position: absolute; 67 | height: 23px; 68 | width: 23px; 69 | left: 1px; 70 | top: 1px; 71 | border-radius: 50%; 72 | display: none; 73 | background: #991D57; 74 | text-align: center; 75 | line-height: 23px; 76 | color: yellow; 77 | font-weight: normal; 78 | } 79 | input[type="radio"]:checked + label:after { 80 | display: inline-block; 81 | } 82 | .btn-warning { 83 | font-size: 20px; 84 | background: #CCCCCC; 85 | border: 0; 86 | border-radius: 20px; 87 | padding: 5px 10px; 88 | color: #000; 89 | } 90 | .tag-input-file { 91 | color: #fff; 92 | } 93 | } 94 | .form-control-relative { 95 | position: relative; 96 | #loading { 97 | position: absolute; 98 | top: 0; 99 | left: 90px; 100 | width: 40px; 101 | height: 40px; 102 | display: none; 103 | img { 104 | width: 100%; 105 | } 106 | } 107 | } 108 | } 109 | } 110 | } 111 | .clr { 112 | clear: both; 113 | } 114 | .validate-error-class { 115 | color:#FF0000; /* red */ 116 | } -------------------------------------------------------------------------------- /assets/less/style-v6.less: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | .form-contact { 6 | max-width: 100%; 7 | background: #FB540D; 8 | border-bottom-left-radius: 10px; 9 | border-bottom-right-radius: 10px; 10 | border-radius: 0; 11 | border: 0; 12 | padding: 30px; 13 | .form-legend { 14 | color: #fff; 15 | font-size: 25px; 16 | font-weight: bold; 17 | width: 100%; 18 | text-align: center; 19 | display: inline-block; 20 | } 21 | .form-block { 22 | margin: 10px 0; 23 | .tag-label { 24 | box-sizing: border-box; 25 | float: none; 26 | width: 100%; 27 | color: #fff; 28 | font-weight: bold; 29 | font-size: 20px; 30 | padding: 0; 31 | text-align: center; 32 | } 33 | .wrap-form-control { 34 | float: none; 35 | width: 100%; 36 | padding: 0; 37 | box-sizing: border-box; 38 | text-align: center; 39 | .tag-input { 40 | width: 100%; 41 | padding: 5px 20px; 42 | box-sizing: border-box; 43 | background: #fff; 44 | font-size: 20px; 45 | border-radius: 0px; 46 | border: 0; 47 | text-align: center; 48 | } 49 | input[type="radio"] { 50 | display:none; 51 | } 52 | input[type="radio"] + label { 53 | padding: 0px 30px 10px 30px; 54 | position: relative; 55 | color: #fff; 56 | } 57 | input[type="radio"] + label:before { 58 | content: ""; 59 | width: 25px; 60 | height: 25px; 61 | border: 2px solid #fff; 62 | display: inline-block; 63 | border-radius: 50%; 64 | cursor: pointer; 65 | position: absolute; 66 | left: 0; 67 | z-index: 2; 68 | } 69 | input[type="radio"] + label:after { 70 | content: "\f00c"; 71 | font-family: FontAwesome; 72 | position: absolute; 73 | height: 23px; 74 | width: 23px; 75 | left: 1px; 76 | top: 1px; 77 | border-radius: 50%; 78 | display: none; 79 | background: #991D57; 80 | text-align: center; 81 | line-height: 23px; 82 | color: yellow; 83 | font-weight: normal; 84 | } 85 | input[type="radio"]:checked + label:after { 86 | display: inline-block; 87 | } 88 | .btn-warning { 89 | font-size: 20px; 90 | border-radius: 20px; 91 | padding: 5px 10px; 92 | width: 100%; 93 | background: none; 94 | border: 2px solid #fff; 95 | color: #fff; 96 | text-transform: uppercase; 97 | font-weight: bold; 98 | &:hover { 99 | background: blueviolet; 100 | } 101 | } 102 | .tag-input-file { 103 | color: #fff; 104 | margin: 0 auto; 105 | } 106 | .g-recaptcha > div { 107 | margin: 0 auto; 108 | } 109 | } 110 | .form-control-relative { 111 | position: relative; 112 | #loading { 113 | position: absolute; 114 | top: 0; 115 | left: 90px; 116 | width: 40px; 117 | height: 40px; 118 | display: none; 119 | img { 120 | width: 100%; 121 | } 122 | } 123 | } 124 | } 125 | } 126 | } 127 | .clr { 128 | clear: both; 129 | } 130 | .validate-error-class { 131 | color:#FF0000; /* red */ 132 | } -------------------------------------------------------------------------------- /assets/less/style.less: -------------------------------------------------------------------------------- 1 | .wrap-form { 2 | max-width: 600px; 3 | padding: 15px; 4 | margin: 50px auto; 5 | .form-contact { 6 | max-width: 100%; 7 | background: #fff; 8 | padding: 15px; 9 | border: 1px solid #ccc; 10 | border-radius: 10px; 11 | position: relative; 12 | .form-legend { 13 | position: absolute; 14 | top: -11px; 15 | left: 30px; 16 | background: #fff; 17 | padding: 0 5px; 18 | color: #666; 19 | font-weight: bold; 20 | } 21 | .form-block { 22 | margin: 10px 0; 23 | .tag-label { 24 | float: left; 25 | width: 30%; 26 | padding: 10px; 27 | box-sizing: border-box; 28 | font-weight: normal; 29 | color: #666; 30 | } 31 | .wrap-form-control { 32 | float: right; 33 | width: 70%; 34 | padding: 10px; 35 | box-sizing: border-box; 36 | .tag-input { 37 | width: 100%; 38 | padding: 5px 10px; 39 | box-sizing: border-box; 40 | background: none; 41 | border: 1px solid #ccc; 42 | border-radius: 5px; 43 | } 44 | input[type="radio"] { 45 | display:none; 46 | } 47 | input[type="radio"] + label { 48 | padding: 0px 30px 10px 30px; 49 | position: relative; 50 | } 51 | input[type="radio"] + label:before { 52 | content: ""; 53 | width: 25px; 54 | height: 25px; 55 | border: 2px solid #ccc; 56 | display: inline-block; 57 | border-radius: 50%; 58 | cursor: pointer; 59 | position: absolute; 60 | left: 0; 61 | z-index: 2; 62 | } 63 | input[type="radio"] + label:after { 64 | content: "\f00c"; 65 | font-family: FontAwesome; 66 | position: absolute; 67 | height: 23px; 68 | width: 23px; 69 | left: 1px; 70 | top: 1px; 71 | border-radius: 50%; 72 | display: none; 73 | background: #ec971f; 74 | text-align: center; 75 | line-height: 23px; 76 | color: #fff; 77 | font-weight: normal; 78 | } 79 | input[type="radio"]:checked + label:after { 80 | display: inline-block; 81 | } 82 | } 83 | .form-control-relative { 84 | position: relative; 85 | #loading { 86 | position: absolute; 87 | top: 0; 88 | left: 90px; 89 | width: 40px; 90 | height: 40px; 91 | display: none; 92 | img { 93 | width: 100%; 94 | } 95 | } 96 | } 97 | } 98 | } 99 | } 100 | .clr { 101 | clear: both; 102 | } 103 | .validate-error-class { 104 | color:#FF0000; /* red */ 105 | } 106 | @media (min-width:380px) and (max-width:520px) { 107 | .wrap-form { 108 | .form-contact { 109 | .form-block { 110 | .tag-label { 111 | float: none; 112 | } 113 | .wrap-form-control { 114 | float: none; 115 | } 116 | } 117 | } 118 | } 119 | } -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | conn = new mysqli($servername, $username, $password, $dbname); 10 | 11 | // Check connection 12 | if ($this->conn->connect_error) { 13 | die("Connection failed: " . $this->conn->connect_error); 14 | } 15 | // return $conn; 16 | } 17 | public function select($id) { 18 | 19 | } 20 | public function insert($talbe, $object) { 21 | $sql = "INSERT INTO " . $talbe . "("; 22 | $sql_first = ''; 23 | $sql_last = ") VALUES ("; 24 | foreach ($object as $key => $value) { 25 | $sql_first .= $key . ','; 26 | $sql_last .= "'".$value."'" . ','; 27 | } 28 | $sql_first = rtrim($sql_first, ','); 29 | $sql_last = rtrim($sql_last, ','); 30 | $sql .= $sql_first . $sql_last .")"; 31 | return $this->conn->query($sql); 32 | // return $sql; 33 | } 34 | public function update() { 35 | 36 | } 37 | public function delete() { 38 | 39 | } 40 | public function close() { 41 | $this->conn->close(); 42 | } 43 | } -------------------------------------------------------------------------------- /database/information.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.5.1 3 | -- http://www.phpmyadmin.net 4 | -- 5 | -- Host: 127.0.0.1 6 | -- Generation Time: Jan 18, 2017 at 02:40 AM 7 | -- Server version: 10.1.13-MariaDB 8 | -- PHP Version: 5.6.23 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET time_zone = "+00:00"; 12 | 13 | 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 | /*!40101 SET NAMES utf8mb4 */; 18 | 19 | -- 20 | -- Database: `contact-form` 21 | -- 22 | 23 | -- -------------------------------------------------------- 24 | 25 | -- 26 | -- Table structure for table `information` 27 | -- 28 | 29 | CREATE TABLE `information` ( 30 | `id` int(11) NOT NULL, 31 | `name` varchar(250) NOT NULL, 32 | `email` varchar(250) NOT NULL, 33 | `subject` varchar(250) NOT NULL, 34 | `message` text NOT NULL, 35 | `gender` varchar(250) NOT NULL, 36 | `file_upload` varchar(250) NOT NULL 37 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 38 | 39 | -- 40 | -- Dumping data for table `information` 41 | -- 42 | 43 | INSERT INTO `information` (`id`, `name`, `email`, `subject`, `message`, `gender`, `file_upload`) VALUES 44 | (1, 'toan', 'stoannguyen2205@gmail.com', 'Select one', 'e', 'male', 'uploads/1484617870avatar-2.jpg'); 45 | 46 | -- 47 | -- Indexes for dumped tables 48 | -- 49 | 50 | -- 51 | -- Indexes for table `information` 52 | -- 53 | ALTER TABLE `information` 54 | ADD PRIMARY KEY (`id`); 55 | 56 | -- 57 | -- AUTO_INCREMENT for dumped tables 58 | -- 59 | 60 | -- 61 | -- AUTO_INCREMENT for table `information` 62 | -- 63 | ALTER TABLE `information` 64 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; 65 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 66 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 67 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 68 | -------------------------------------------------------------------------------- /document.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/document.txt -------------------------------------------------------------------------------- /sendmail.php: -------------------------------------------------------------------------------- 1 | result = true; 8 | $return->message = "true"; 9 | if (isset($_POST['submit'])) { 10 | $path = ""; 11 | $name = ""; 12 | if ($_FILES['file_upload']['name'] != NULL) { 13 | $path = "uploads/"; 14 | if (!is_dir($path)) { 15 | mkdir($path); 16 | } 17 | $tmp_name = $_FILES['file_upload']['tmp_name']; 18 | $name = time() . $_FILES['file_upload']['name']; 19 | // Upload file 20 | move_uploaded_file($tmp_name, $path . $name); 21 | } 22 | 23 | 24 | $object = new stdClass(); 25 | $object->name = $_POST['name']; 26 | $object->email = $_POST['email']; 27 | $object->subject = $_POST['subject']; 28 | $object->message = $_POST['message']; 29 | $object->gender = $_POST['gender']; 30 | $object->file_upload = $path . $name; 31 | if (!$object->email) { 32 | $return->result = false; 33 | $return->message = "Email is required!
"; 34 | echo json_encode($return); 35 | exit; 36 | } 37 | //save data to database 38 | $result = @saveData($object); 39 | if (!$result) { 40 | $return->result = false; 41 | } 42 | // send mail client 43 | $result = sendMail(CF_CLIENT_EMAIL_TITLE, $object->email, $object->name, $object, "You've just contacted us with the folowing information:", CF_CLIENT_EMAIL_END_MESSAGE); 44 | if ($result !== true) { 45 | $return->result = false; 46 | $return->message = "Can not sent email."; 47 | } 48 | //send mail admin 49 | $result = sendMail(CF_ADMIN_EMAIL_TITLE, CF_EMAIL_FROM, CF_EMAIL_FROM_NAME, $object, "New contacting us with the folowing information:"); 50 | if ($result !== true) { 51 | $return->result = false; 52 | } 53 | } else { 54 | $return->result = false; 55 | $return->message = "No Form Sumited!"; 56 | } 57 | if ($return->result) { 58 | $return->message = "Thank you for contacting us!"; 59 | } 60 | echo json_encode($return); 61 | exit; 62 | 63 | /** 64 | * * save data to database 65 | * */ 66 | function saveData($data) { 67 | $database = new Database(); 68 | $database->connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); 69 | $result = $database->insert('information', $data); 70 | $database->close(); 71 | return $result; 72 | } 73 | 74 | function sendMail($subject, $send_to, $sento_name, $data, $title = "", $message = "") { 75 | $mail = new PHPMailer(); 76 | 77 | $mail->isSMTP(); 78 | $mail->Host = CF_HOST; 79 | $mail->SMTPAuth = true; 80 | $mail->Username = CF_USERNAME; 81 | $mail->Password = CF_PASSWORD; 82 | $mail->SMTPSecure = CF_SECURE; 83 | $mail->Port = CF_PORT; 84 | 85 | $mail->setFrom(CF_EMAIL_FROM, CF_EMAIL_FROM_NAME); 86 | $mail->addAddress($send_to, $sento_name); 87 | $mail->addReplyTo(CF_EMAIL_REPLYTO, CF_EMAIL_REPLYTO_NAME); 88 | $mail->addCC(CF_EMAIL_CC); 89 | $mail->addBCC(CF_EMAIL_BCC); 90 | if ($data->file_upload) { 91 | $mail->addAttachment($data->file_upload); 92 | } 93 | $mail->isHTML(true); 94 | 95 | $mail->Subject = $subject; 96 | $body = $title . '
'; 97 | foreach ($data as $key => $val) { 98 | if ($key == "file_upload") 99 | continue; 100 | $body .='' . ucfirst($key) . ": " . $val . '
'; 101 | } 102 | $body .= $message; 103 | $mail->Body = $body; 104 | 105 | if (!$mail->send()) { 106 | return 'Mailer Error: ' . $mail->ErrorInfo; 107 | } else { 108 | return true; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /uploads/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !.gitignore 4 | !.htaccess 5 | !index.html -------------------------------------------------------------------------------- /uploads/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Order Deny,Allow 4 | Deny from All 5 | 6 | -------------------------------------------------------------------------------- /uploads/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/uploads/index.html -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/phpmailer/phpmailer/extras/EasyPeasyICS.php', 10 | 'PHPMailer' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php', 11 | 'PHPMailerOAuth' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauth.php', 12 | 'PHPMailerOAuthGoogle' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php', 13 | 'POP3' => $vendorDir . '/phpmailer/phpmailer/class.pop3.php', 14 | 'SMTP' => $vendorDir . '/phpmailer/phpmailer/class.smtp.php', 15 | 'ntlm_sasl_client_class' => $vendorDir . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php', 16 | 'phpmailerException' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php', 17 | ); 18 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION'); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInitef1e9811edd4d2924a89bdac2b5ccf9c::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | return $loader; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/..' . '/phpmailer/phpmailer/extras/EasyPeasyICS.php', 11 | 'PHPMailer' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmailer.php', 12 | 'PHPMailerOAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmaileroauth.php', 13 | 'PHPMailerOAuthGoogle' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php', 14 | 'POP3' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.pop3.php', 15 | 'SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.smtp.php', 16 | 'ntlm_sasl_client_class' => __DIR__ . '/..' . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php', 17 | 'phpmailerException' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmailer.php', 18 | ); 19 | 20 | public static function getInitializer(ClassLoader $loader) 21 | { 22 | return \Closure::bind(function () use ($loader) { 23 | $loader->classMap = ComposerStaticInitef1e9811edd4d2924a89bdac2b5ccf9c::$classMap; 24 | 25 | }, null, ClassLoader::class); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/composer/installed.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "phpmailer/phpmailer", 4 | "version": "v5.2.22", 5 | "version_normalized": "5.2.22.0", 6 | "source": { 7 | "type": "git", 8 | "url": "https://github.com/PHPMailer/PHPMailer.git", 9 | "reference": "b18cb98131bd83103ccb26a888fdfe3177b8a663" 10 | }, 11 | "dist": { 12 | "type": "zip", 13 | "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/b18cb98131bd83103ccb26a888fdfe3177b8a663", 14 | "reference": "b18cb98131bd83103ccb26a888fdfe3177b8a663", 15 | "shasum": "" 16 | }, 17 | "require": { 18 | "php": ">=5.0.0" 19 | }, 20 | "require-dev": { 21 | "phpdocumentor/phpdocumentor": "*", 22 | "phpunit/phpunit": "4.7.*" 23 | }, 24 | "suggest": { 25 | "league/oauth2-google": "Needed for Google XOAUTH2 authentication" 26 | }, 27 | "time": "2017-01-09 09:33:47", 28 | "type": "library", 29 | "installation-source": "dist", 30 | "autoload": { 31 | "classmap": [ 32 | "class.phpmailer.php", 33 | "class.phpmaileroauth.php", 34 | "class.phpmaileroauthgoogle.php", 35 | "class.smtp.php", 36 | "class.pop3.php", 37 | "extras/EasyPeasyICS.php", 38 | "extras/ntlm_sasl_client.php" 39 | ] 40 | }, 41 | "notification-url": "https://packagist.org/downloads/", 42 | "license": [ 43 | "LGPL-2.1" 44 | ], 45 | "authors": [ 46 | { 47 | "name": "Jim Jagielski", 48 | "email": "jimjag@gmail.com" 49 | }, 50 | { 51 | "name": "Marcus Bointon", 52 | "email": "phpmailer@synchromedia.co.uk" 53 | }, 54 | { 55 | "name": "Andy Prevost", 56 | "email": "codeworxtech@users.sourceforge.net" 57 | }, 58 | { 59 | "name": "Brent R. Matzelle" 60 | } 61 | ], 62 | "description": "PHPMailer is a full-featured email creation and transfer class for PHP" 63 | } 64 | ] 65 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/PHPMailerAutoload.php: -------------------------------------------------------------------------------- 1 | 8 | * @author Jim Jagielski (jimjag) 9 | * @author Andy Prevost (codeworxtech) 10 | * @author Brent R. Matzelle (original founder) 11 | * @copyright 2012 - 2014 Marcus Bointon 12 | * @copyright 2010 - 2012 Jim Jagielski 13 | * @copyright 2004 - 2009 Andy Prevost 14 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 15 | * @note This program is distributed in the hope that it will be useful - WITHOUT 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | * FITNESS FOR A PARTICULAR PURPOSE. 18 | */ 19 | 20 | /** 21 | * PHPMailer SPL autoloader. 22 | * @param string $classname The name of the class to load 23 | */ 24 | function PHPMailerAutoload($classname) 25 | { 26 | //Can't use __DIR__ as it's only in PHP 5.3+ 27 | $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; 28 | if (is_readable($filename)) { 29 | require $filename; 30 | } 31 | } 32 | 33 | if (version_compare(PHP_VERSION, '5.1.2', '>=')) { 34 | //SPL autoloading was introduced in PHP 5.1.2 35 | if (version_compare(PHP_VERSION, '5.3.0', '>=')) { 36 | spl_autoload_register('PHPMailerAutoload', true, true); 37 | } else { 38 | spl_autoload_register('PHPMailerAutoload'); 39 | } 40 | } else { 41 | /** 42 | * Fall back to traditional autoload for old PHP versions 43 | * @param string $classname The name of the class to load 44 | */ 45 | function __autoload($classname) 46 | { 47 | PHPMailerAutoload($classname); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/VERSION: -------------------------------------------------------------------------------- 1 | 5.2.22 2 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/class.phpmaileroauthgoogle.php: -------------------------------------------------------------------------------- 1 | 8 | * @author Jim Jagielski (jimjag) 9 | * @author Andy Prevost (codeworxtech) 10 | * @author Brent R. Matzelle (original founder) 11 | * @copyright 2012 - 2014 Marcus Bointon 12 | * @copyright 2010 - 2012 Jim Jagielski 13 | * @copyright 2004 - 2009 Andy Prevost 14 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 15 | * @note This program is distributed in the hope that it will be useful - WITHOUT 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | * FITNESS FOR A PARTICULAR PURPOSE. 18 | */ 19 | 20 | /** 21 | * PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider. 22 | * @package PHPMailer 23 | * @author @sherryl4george 24 | * @author Marcus Bointon (@Synchro) 25 | * @link https://github.com/thephpleague/oauth2-client 26 | */ 27 | class PHPMailerOAuthGoogle 28 | { 29 | private $oauthUserEmail = ''; 30 | private $oauthRefreshToken = ''; 31 | private $oauthClientId = ''; 32 | private $oauthClientSecret = ''; 33 | 34 | /** 35 | * @param string $UserEmail 36 | * @param string $ClientSecret 37 | * @param string $ClientId 38 | * @param string $RefreshToken 39 | */ 40 | public function __construct( 41 | $UserEmail, 42 | $ClientSecret, 43 | $ClientId, 44 | $RefreshToken 45 | ) { 46 | $this->oauthClientId = $ClientId; 47 | $this->oauthClientSecret = $ClientSecret; 48 | $this->oauthRefreshToken = $RefreshToken; 49 | $this->oauthUserEmail = $UserEmail; 50 | } 51 | 52 | private function getProvider() 53 | { 54 | return new League\OAuth2\Client\Provider\Google([ 55 | 'clientId' => $this->oauthClientId, 56 | 'clientSecret' => $this->oauthClientSecret 57 | ]); 58 | } 59 | 60 | private function getGrant() 61 | { 62 | return new \League\OAuth2\Client\Grant\RefreshToken(); 63 | } 64 | 65 | private function getToken() 66 | { 67 | $provider = $this->getProvider(); 68 | $grant = $this->getGrant(); 69 | return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]); 70 | } 71 | 72 | public function getOauth64() 73 | { 74 | $token = $this->getToken(); 75 | return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001"); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phpmailer/phpmailer", 3 | "type": "library", 4 | "description": "PHPMailer is a full-featured email creation and transfer class for PHP", 5 | "authors": [ 6 | { 7 | "name": "Marcus Bointon", 8 | "email": "phpmailer@synchromedia.co.uk" 9 | }, 10 | { 11 | "name": "Jim Jagielski", 12 | "email": "jimjag@gmail.com" 13 | }, 14 | { 15 | "name": "Andy Prevost", 16 | "email": "codeworxtech@users.sourceforge.net" 17 | }, 18 | { 19 | "name": "Brent R. Matzelle" 20 | } 21 | ], 22 | "require": { 23 | "php": ">=5.0.0" 24 | }, 25 | "require-dev": { 26 | "phpdocumentor/phpdocumentor": "*", 27 | "phpunit/phpunit": "4.7.*" 28 | }, 29 | "suggest": { 30 | "league/oauth2-google": "Needed for Google XOAUTH2 authentication" 31 | }, 32 | "autoload": { 33 | "classmap": [ 34 | "class.phpmailer.php", 35 | "class.phpmaileroauth.php", 36 | "class.phpmaileroauthgoogle.php", 37 | "class.smtp.php", 38 | "class.pop3.php", 39 | "extras/EasyPeasyICS.php", 40 | "extras/ntlm_sasl_client.php" 41 | ] 42 | }, 43 | "license": "LGPL-2.1" 44 | } 45 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/DKIM.phps: -------------------------------------------------------------------------------- 1 | setFrom('from@example.com', 'First Last'); 16 | //Set an alternative reply-to address 17 | $mail->addReplyTo('replyto@example.com', 'First Last'); 18 | //Set who the message is to be sent to 19 | $mail->addAddress('whoto@example.com', 'John Doe'); 20 | //Set the subject line 21 | $mail->Subject = 'PHPMailer DKIM test'; 22 | //This should be the same as the domain of your From address 23 | $mail->DKIM_domain = 'example.com'; 24 | //Path to your private key file 25 | $mail->DKIM_private = 'dkim_private.pem'; 26 | //Set this to your own selector 27 | $mail->DKIM_selector = 'phpmailer'; 28 | //If your private key has a passphrase, set it here 29 | $mail->DKIM_passphrase = ''; 30 | //The identity you're signing as - usually your From address 31 | $mail->DKIM_identity = $mail->From; 32 | 33 | //send the message, check for errors 34 | if (!$mail->send()) { 35 | echo "Mailer Error: " . $mail->ErrorInfo; 36 | } else { 37 | echo "Message sent!"; 38 | } 39 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/contactform.phps: -------------------------------------------------------------------------------- 1 | isSMTP(); 18 | $mail->Host = 'localhost'; 19 | $mail->Port = 25; 20 | 21 | //Use a fixed address in your own domain as the from address 22 | //**DO NOT** use the submitter's address here as it will be forgery 23 | //and will cause your messages to fail SPF checks 24 | $mail->setFrom('from@example.com', 'First Last'); 25 | //Send the message to yourself, or whoever should receive contact for submissions 26 | $mail->addAddress('whoto@example.com', 'John Doe'); 27 | //Put the submitter's address in a reply-to header 28 | //This will fail if the address provided is invalid, 29 | //in which case we should ignore the whole request 30 | if ($mail->addReplyTo($_POST['email'], $_POST['name'])) { 31 | $mail->Subject = 'PHPMailer contact form'; 32 | //Keep it simple - don't use HTML 33 | $mail->isHTML(false); 34 | //Build a simple message body 35 | $mail->Body = <<send()) { 42 | //The reason for failing to send will be in $mail->ErrorInfo 43 | //but you shouldn't display errors to users - process the error, log it on your server. 44 | $msg = 'Sorry, something went wrong. Please try again later.'; 45 | } else { 46 | $msg = 'Message sent! Thanks for contacting us.'; 47 | } 48 | } else { 49 | $msg = 'Invalid email address, message ignored.'; 50 | } 51 | } 52 | ?> 53 | 54 | 55 | 56 | 57 | Contact form 58 | 59 | 60 |

Contact us

61 | $msg"; 63 | } ?> 64 |
65 |
66 |
67 |
68 | 69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/contents.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/vendor/phpmailer/phpmailer/examples/contents.html -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/contentsutf8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PHPMailer Test 6 | 7 | 8 |
9 |

This is a test of PHPMailer.

10 |
11 | PHPMailer rocks 12 |
13 |

This example uses HTML.

14 |

Chinese text: 郵件內容為空

15 |

Russian text: Пустое тело сообщения

16 |

Armenian text: Հաղորդագրությունը դատարկ է

17 |

Czech text: Prázdné tělo zprávy

18 |

Emoji: 😂 🦄 💥 📤 📧

19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/exceptions.phps: -------------------------------------------------------------------------------- 1 | setFrom('from@example.com', 'First Last'); 14 | //Set an alternative reply-to address 15 | $mail->addReplyTo('replyto@example.com', 'First Last'); 16 | //Set who the message is to be sent to 17 | $mail->addAddress('whoto@example.com', 'John Doe'); 18 | //Set the subject line 19 | $mail->Subject = 'PHPMailer Exceptions test'; 20 | //Read an HTML message body from an external file, convert referenced images to embedded, 21 | //and convert the HTML into a basic plain-text alternative body 22 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); 23 | //Replace the plain text body with one created manually 24 | $mail->AltBody = 'This is a plain-text message body'; 25 | //Attach an image file 26 | $mail->addAttachment('images/phpmailer_mini.png'); 27 | //send the message 28 | //Note that we don't need check the response from this because it will throw an exception if it has trouble 29 | $mail->send(); 30 | echo "Message sent!"; 31 | } catch (phpmailerException $e) { 32 | echo $e->errorMessage(); //Pretty error messages from PHPMailer 33 | } catch (Exception $e) { 34 | echo $e->getMessage(); //Boring error messages from anything else! 35 | } 36 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/gmail.phps: -------------------------------------------------------------------------------- 1 | isSMTP(); 17 | 18 | //Enable SMTP debugging 19 | // 0 = off (for production use) 20 | // 1 = client messages 21 | // 2 = client and server messages 22 | $mail->SMTPDebug = 2; 23 | 24 | //Ask for HTML-friendly debug output 25 | $mail->Debugoutput = 'html'; 26 | 27 | //Set the hostname of the mail server 28 | $mail->Host = 'smtp.gmail.com'; 29 | // use 30 | // $mail->Host = gethostbyname('smtp.gmail.com'); 31 | // if your network does not support SMTP over IPv6 32 | 33 | //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission 34 | $mail->Port = 587; 35 | 36 | //Set the encryption system to use - ssl (deprecated) or tls 37 | $mail->SMTPSecure = 'tls'; 38 | 39 | //Whether to use SMTP authentication 40 | $mail->SMTPAuth = true; 41 | 42 | //Username to use for SMTP authentication - use full email address for gmail 43 | $mail->Username = "username@gmail.com"; 44 | 45 | //Password to use for SMTP authentication 46 | $mail->Password = "yourpassword"; 47 | 48 | //Set who the message is to be sent from 49 | $mail->setFrom('from@example.com', 'First Last'); 50 | 51 | //Set an alternative reply-to address 52 | $mail->addReplyTo('replyto@example.com', 'First Last'); 53 | 54 | //Set who the message is to be sent to 55 | $mail->addAddress('whoto@example.com', 'John Doe'); 56 | 57 | //Set the subject line 58 | $mail->Subject = 'PHPMailer GMail SMTP test'; 59 | 60 | //Read an HTML message body from an external file, convert referenced images to embedded, 61 | //convert HTML into a basic plain-text alternative body 62 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); 63 | 64 | //Replace the plain text body with one created manually 65 | $mail->AltBody = 'This is a plain-text message body'; 66 | 67 | //Attach an image file 68 | $mail->addAttachment('images/phpmailer_mini.png'); 69 | 70 | //send the message, check for errors 71 | if (!$mail->send()) { 72 | echo "Mailer Error: " . $mail->ErrorInfo; 73 | } else { 74 | echo "Message sent!"; 75 | } 76 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps: -------------------------------------------------------------------------------- 1 | isSMTP(); 21 | 22 | //Enable SMTP debugging 23 | // 0 = off (for production use) 24 | // 1 = client messages 25 | // 2 = client and server messages 26 | $mail->SMTPDebug = 0; 27 | 28 | //Ask for HTML-friendly debug output 29 | $mail->Debugoutput = 'html'; 30 | 31 | //Set the hostname of the mail server 32 | $mail->Host = 'smtp.gmail.com'; 33 | 34 | //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission 35 | $mail->Port = 587; 36 | 37 | //Set the encryption system to use - ssl (deprecated) or tls 38 | $mail->SMTPSecure = 'tls'; 39 | 40 | //Whether to use SMTP authentication 41 | $mail->SMTPAuth = true; 42 | 43 | //Set AuthType 44 | $mail->AuthType = 'XOAUTH2'; 45 | 46 | //User Email to use for SMTP authentication - Use the same Email used in Google Developer Console 47 | $mail->oauthUserEmail = "someone@gmail.com"; 48 | 49 | //Obtained From Google Developer Console 50 | $mail->oauthClientId = "RANDOMCHARS-----duv1n2.apps.googleusercontent.com"; 51 | 52 | //Obtained From Google Developer Console 53 | $mail->oauthClientSecret = "RANDOMCHARS-----lGyjPcRtvP"; 54 | 55 | //Obtained By running get_oauth_token.php after setting up APP in Google Developer Console. 56 | //Set Redirect URI in Developer Console as [https/http]:////get_oauth_token.php 57 | // eg: http://localhost/phpmail/get_oauth_token.php 58 | $mail->oauthRefreshToken = "RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0"; 59 | 60 | //Set who the message is to be sent from 61 | //For gmail, this generally needs to be the same as the user you logged in as 62 | $mail->setFrom('from@example.com', 'First Last'); 63 | 64 | //Set who the message is to be sent to 65 | $mail->addAddress('whoto@example.com', 'John Doe'); 66 | 67 | //Set the subject line 68 | $mail->Subject = 'PHPMailer GMail SMTP test'; 69 | 70 | //Read an HTML message body from an external file, convert referenced images to embedded, 71 | //convert HTML into a basic plain-text alternative body 72 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); 73 | 74 | //Replace the plain text body with one created manually 75 | $mail->AltBody = 'This is a plain-text message body'; 76 | 77 | //Attach an image file 78 | $mail->addAttachment('images/phpmailer_mini.png'); 79 | 80 | //send the message, check for errors 81 | if (!$mail->send()) { 82 | echo "Mailer Error: " . $mail->ErrorInfo; 83 | } else { 84 | echo "Message sent!"; 85 | } 86 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/images/phpmailer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/vendor/phpmailer/phpmailer/examples/images/phpmailer.png -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Ajax-contact-form-and-send-mail-PHP/e872db6c6231c583cf6b367b52704c196b511d57/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/mail.phps: -------------------------------------------------------------------------------- 1 | setFrom('from@example.com', 'First Last'); 12 | //Set an alternative reply-to address 13 | $mail->addReplyTo('replyto@example.com', 'First Last'); 14 | //Set who the message is to be sent to 15 | $mail->addAddress('whoto@example.com', 'John Doe'); 16 | //Set the subject line 17 | $mail->Subject = 'PHPMailer mail() test'; 18 | //Read an HTML message body from an external file, convert referenced images to embedded, 19 | //convert HTML into a basic plain-text alternative body 20 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); 21 | //Replace the plain text body with one created manually 22 | $mail->AltBody = 'This is a plain-text message body'; 23 | //Attach an image file 24 | $mail->addAttachment('images/phpmailer_mini.png'); 25 | 26 | //send the message, check for errors 27 | if (!$mail->send()) { 28 | echo "Mailer Error: " . $mail->ErrorInfo; 29 | } else { 30 | echo "Message sent!"; 31 | } 32 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/mailing_list.phps: -------------------------------------------------------------------------------- 1 | isSMTP(); 14 | $mail->Host = 'smtp.example.com'; 15 | $mail->SMTPAuth = true; 16 | $mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent, reduces SMTP overhead 17 | $mail->Port = 25; 18 | $mail->Username = 'yourname@example.com'; 19 | $mail->Password = 'yourpassword'; 20 | $mail->setFrom('list@example.com', 'List manager'); 21 | $mail->addReplyTo('list@example.com', 'List manager'); 22 | 23 | $mail->Subject = "PHPMailer Simple database mailing list test"; 24 | 25 | //Same body for all messages, so set this before the sending loop 26 | //If you generate a different body for each recipient (e.g. you're using a templating system), 27 | //set it inside the loop 28 | $mail->msgHTML($body); 29 | //msgHTML also sets AltBody, but if you want a custom one, set it afterwards 30 | $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; 31 | 32 | //Connect to the database and select the recipients from your mailing list that have not yet been sent to 33 | //You'll need to alter this to match your database 34 | $mysql = mysqli_connect('localhost', 'username', 'password'); 35 | mysqli_select_db($mysql, 'mydb'); 36 | $result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = false'); 37 | 38 | foreach ($result as $row) { //This iterator syntax only works in PHP 5.4+ 39 | $mail->addAddress($row['email'], $row['full_name']); 40 | if (!empty($row['photo'])) { 41 | $mail->addStringAttachment($row['photo'], 'YourPhoto.jpg'); //Assumes the image data is stored in the DB 42 | } 43 | 44 | if (!$mail->send()) { 45 | echo "Mailer Error (" . str_replace("@", "@", $row["email"]) . ') ' . $mail->ErrorInfo . '
'; 46 | break; //Abandon sending 47 | } else { 48 | echo "Message sent to :" . $row['full_name'] . ' (' . str_replace("@", "@", $row['email']) . ')
'; 49 | //Mark it as sent in the DB 50 | mysqli_query( 51 | $mysql, 52 | "UPDATE mailinglist SET sent = true WHERE email = '" . 53 | mysqli_real_escape_string($mysql, $row['email']) . "'" 54 | ); 55 | } 56 | // Clear all addresses and attachments for next loop 57 | $mail->clearAddresses(); 58 | $mail->clearAttachments(); 59 | } 60 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps: -------------------------------------------------------------------------------- 1 | isSMTP(); 18 | //Enable SMTP debugging 19 | // 0 = off (for production use) 20 | // 1 = client messages 21 | // 2 = client and server messages 22 | $mail->SMTPDebug = 2; 23 | //Ask for HTML-friendly debug output 24 | $mail->Debugoutput = 'html'; 25 | //Set the hostname of the mail server 26 | $mail->Host = "mail.example.com"; 27 | //Set the SMTP port number - likely to be 25, 465 or 587 28 | $mail->Port = 25; 29 | //Whether to use SMTP authentication 30 | $mail->SMTPAuth = false; 31 | //Set who the message is to be sent from 32 | $mail->setFrom('from@example.com', 'First Last'); 33 | //Set an alternative reply-to address 34 | $mail->addReplyTo('replyto@example.com', 'First Last'); 35 | //Set who the message is to be sent to 36 | $mail->addAddress('whoto@example.com', 'John Doe'); 37 | //Set the subject line 38 | $mail->Subject = 'PHPMailer POP-before-SMTP test'; 39 | //Read an HTML message body from an external file, convert referenced images to embedded, 40 | //and convert the HTML into a basic plain-text alternative body 41 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); 42 | //Replace the plain text body with one created manually 43 | $mail->AltBody = 'This is a plain-text message body'; 44 | //Attach an image file 45 | $mail->addAttachment('images/phpmailer_mini.png'); 46 | //send the message 47 | //Note that we don't need check the response from this because it will throw an exception if it has trouble 48 | $mail->send(); 49 | echo "Message sent!"; 50 | } catch (phpmailerException $e) { 51 | echo $e->errorMessage(); //Pretty error messages from PHPMailer 52 | } catch (Exception $e) { 53 | echo $e->getMessage(); //Boring error messages from anything else! 54 | } 55 | -------------------------------------------------------------------------------- /vendor/phpmailer/phpmailer/examples/scripts/shAutoloader.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | var sh = SyntaxHighlighter; 4 | 5 | /** 6 | * Provides functionality to dynamically load only the brushes that a needed to render the current page. 7 | * 8 | * There are two syntaxes that autoload understands. For example: 9 | * 10 | * SyntaxHighlighter.autoloader( 11 | * [ 'applescript', 'Scripts/shBrushAppleScript.js' ], 12 | * [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ] 13 | * ); 14 | * 15 | * or a more easily comprehendable one: 16 | * 17 | * SyntaxHighlighter.autoloader( 18 | * 'applescript Scripts/shBrushAppleScript.js', 19 | * 'actionscript3 as3 Scripts/shBrushAS3.js' 20 | * ); 21 | */ 22 | sh.autoloader = function() 23 | { 24 | var list = arguments, 25 | elements = sh.findElements(), 26 | brushes = {}, 27 | scripts = {}, 28 | all = SyntaxHighlighter.all, 29 | allCalled = false, 30 | allParams = null, 31 | i 32 | ; 33 | 34 | SyntaxHighlighter.all = function(params) 35 | { 36 | allParams = params; 37 | allCalled = true; 38 | }; 39 | 40 | function addBrush(aliases, url) 41 | { 42 | for (var i = 0; i < aliases.length; i++) 43 | brushes[aliases[i]] = url; 44 | }; 45 | 46 | function getAliases(item) 47 | { 48 | return item.pop 49 | ? item 50 | : item.split(/\s+/) 51 | ; 52 | } 53 | 54 | // create table of aliases and script urls 55 | for (i = 0; i < list.length; i++) 56 | { 57 | var aliases = getAliases(list[i]), 58 | url = aliases.pop() 59 | ; 60 | 61 | addBrush(aliases, url); 62 | } 63 | 64 | // dynamically add