· 8 years ago · Feb 03, 2018, 11:34 AM
1bool(false) 220 smtp.gmail.com ESMTP t8sm1776565pgr.21 - gsmtp
2hello: 250-smtp.gmail.com at your service, [45.116.123.5]
3250-SIZE 35882577
4250-8BITMIME
5250-STARTTLS
6250-ENHANCEDSTATUSCODES
7250-PIPELINING
8250-CHUNKING
9250 SMTPUTF8
10Failed to send AUTH LOGIN command. Error: 530 5.7.0 Must issue a STARTTLS command first. t8sm1776565pgr.21 - gsmtp
11Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
12Date: Fri, 2 Feb 2018 13:02:25 +0530
13To: demo@example.com
14From: "MyWebsite" <demo@example.com>
15Return-Path: <demo@example.com>
16Subject: =?UTF-8?Q?How=20to=20send=20email=20vi?==?UTF-8?Q?a=20SMTP=20?= =?UTF-8?Q?server=20in=20CodeIgniter?=
17Reply-To: <demo@example.com>
18User-Agent: CodeIgniter
19X-Sender: demo@example.com
20X-Mailer: CodeIgniter
21X-Priority: 3 (Normal)
22Message-ID: <5a741409bc741@gmail.com>
23Mime-Version: 1.0
24
25
26Content-Type: multipart/alternative; boundary="B_ALT_5a741409bc741"
27
28This is a multi-part message in MIME format.
29Your email application may not support this format.
30
31--B_ALT_5a741409bc741
32Content-Type: text/plain; charset=UTF-8
33Content-Transfer-Encoding: 8bit
34
35Sending email via SMTP serverThis email has sent via SMTP server from
36CodeIgniter application.
37
38
39--B_ALT_5a741409bc741
40Content-Type: text/html; charset=UTF-8
41Content-Transfer-Encoding: quoted-printable
42
43=3Ch1=3ESending email via SMTP server=3C/h1=3E=3Cp=3EThis email has sent vi=
44a SMTP server from CodeIgniter application.=3C/p=3E
45
46--B_ALT_5a741409bc741--
47
48bool(false)
49hello: F
50The following SMTP error was encountered: F
51Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
52Date: Fri, 2 Feb 2018 13:12:43 +0530
53To: demo@example.com
54From: "MyWebsite" <demo@example.com>
55Return-Path: <demo@example.com>
56Subject: =?UTF-8?Q?How=20to=20send=20email=20vi?==?UTF-8?Q?a=20SMTP=20?= =?UTF-8?Q?server=20in=20CodeIgniter?=
57Reply-To: <demo@example.com>
58User-Agent: CodeIgniter
59X-Sender: demo@example.com
60X-Mailer: CodeIgniter
61X-Priority: 3 (Normal)
62Message-ID: <5a7416736d6ea@gmail.com>
63Mime-Version: 1.0
64
65
66Content-Type: multipart/alternative; boundary="B_ALT_5a7416736d6ea"
67
68This is a multi-part message in MIME format.
69Your email application may not support this format.
70
71--B_ALT_5a7416736d6ea
72Content-Type: text/plain; charset=UTF-8
73Content-Transfer-Encoding: 8bit
74
75Sending email via SMTP serverThis email has sent via SMTP server from
76CodeIgniter application.
77
78
79--B_ALT_5a7416736d6ea
80Content-Type: text/html; charset=UTF-8
81Content-Transfer-Encoding: quoted-printable
82
83=3Ch1=3ESending email via SMTP server=3C/h1=3E=3Cp=3EThis email has sent vi=
84a SMTP server from CodeIgniter application.=3C/p=3E
85
86--B_ALT_5a7416736d6ea--
87
88$ci = get_instance();
89 $ci->load->library('email');
90 $config['protocol'] = "smtp";
91 $config['smtp_host'] = "mail.google.com";
92 $config['smtp_port'] = "26";
93 $config['smtp_user'] = "********@gmail.com";
94 $config['smtp_pass'] = "************";
95 $config['charset'] = "utf-8";
96 $config['mailtype'] = "html";
97 $config['newline'] = "rn";
98
99 $ci->email->initialize($config);
100
101 $ci->email->from('*********@gmail.com');
102
103 $email_body = "Sending Email from server.";
104
105 $this->email->to($userEmail']);
106 $this->email->subject('Email Subject');
107 $this->email->message($email_body);
108 $email = $this->email->send();