How to send email using simple SMTP commands via Gmail?

to send over gmail, you need to use an encrypted connection. this is not possible with telnet alone, but you can use tools like openssl either connect using the starttls option in openssl to convert the plain connection to encrypted… openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf -ign_eof or connect to a ssl sockect directly… … Read more

What is the email subject length limit?

See RFC 2822, section 2.1.1 to start. There are two limits that this standard places on the number of characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF. As the RFC states later, you can work around this … Read more

CodeIgniter unable to send email using PHP mail()

Had similar issue. That’s working code from the controller : $config = array(); $config[‘useragent’] = “CodeIgniter”; $config[‘mailpath’] = “/usr/bin/sendmail”; // or “/usr/sbin/sendmail” $config[‘protocol’] = “smtp”; $config[‘smtp_host’] = “localhost”; $config[‘smtp_port’] = “25”; $config[‘mailtype’] = ‘html’; $config[‘charset’] = ‘utf-8’; $config[‘newline’] = “\r\n”; $config[‘wordwrap’] = TRUE; $this->load->library(’email’); $this->email->initialize($config); $this->email->from($fromEmail, $fromName); $this->email->to($email); $this->email->subject(‘Тест Email’); $this->email->message($this->load->view(’email/’.$type.’-html’, $data, TRUE)); $this->email->send();