Welcome Guest, Not a member yet? Register   Sign In
Sending emails to multiple users with google mail...
#9

[eluser]Twisted1919[/eluser]
Even if i didn't find an valid solution for my problem ,
i noticed a thing regarding the email class and public smtp servers
When trying to send HTML mail like this :
Code:
$message = 'HTML CONTENT ';
$config = Array(
                'protocol' => 'smtp',
                'smtp_host' => 'mail.myserver.info',
                'smtp_port' => 25,
                'smtp_user' => '[email protected]' ,
                'smtp_pass' => 'mypassword' ,
                'useragent' => 'My Site Agent ',
                'validate'  => TRUE ,
                'priority'  => 3 , //1-high,3-medium,5-normal
                'mailtype'  => 'html'
                );
                $this->load->library('email', $config);
            
            $this->email->set_newline("\r\n");
            $this->email->from($config['smtp_user'], 'Info MySite');
            $this->email->reply_to('[email protected]', 'Site  Administrator');
            $this->email->to('[email protected]');
            
            $this->email->subject('HB ');
            $this->email->message($message);

            if (!$this->email->send())
            {
            show_error($this->email->print_debugger());
            }
            else
            {
            echo $i. ' Your e-mail has been sent!<br />';
            }

I got the following error :
Code:
220 mail.server.info ESMTP

hello: 250-mail.server.info
250-AUTH LOGIN CRAM-MD5 PLAIN
250-AUTH=LOGIN CRAM-MD5 PLAIN
250-STARTTLS
250-PIPELINING
250 8BITMIME

from: 250 ok

to: 250 ok

data: 354 go ahead

451 See http://pobox.com/~djb/docs/smtplf.html.
Urmatoarea eroare SMTP a avut loc: 451 See http://pobox.com/~djb/docs/smtplf.html.
Nu s-a putut trimite email folosind SMTP. Serverul dumneavoastra s-ar putea sa nu fie configurat pentru a trimite mail-uri prin aceasta metoda.

User-Agent: CodeIgniter
Date: Thu, 23 Apr 2009 19:42:28 +0300
From: "Info MySite"
Return-Path:
Reply-To: "Site Administrator"
To: [email protected]
Subject: HB
X-Sender: [email protected]
X-Mailer: My Site Agent
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: multipart/alternative; boundary="B_ALT_49f09a746924c"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_49f09a746924c
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

So the quick fix is to add to config array following values :

Code:
$config = Array(
                'protocol' => 'smtp',
                'smtp_host' => 'mail.server.info',
                'smtp_port' => 25,
                'smtp_user' => '[email protected]' ,
                'smtp_pass' => 'smtp password' ,
                'useragent' => 'My Site Agent ',
                'validate'  => TRUE ,
                'priority'  => 3 , //1-high,3-medium,5-normal
                'mailtype'  => 'html' ,
                'crlf'        => "\r\n" ,
                'newline'   => "\r\n"
                );

This way , the html mail is sent .
Hope it helps Smile


Messages In This Thread
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 08:00 AM
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 08:13 AM
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 08:27 AM
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 08:34 AM
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 08:37 AM
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 08:44 AM
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 08:45 AM
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 08:53 AM
Sending emails to multiple users with google mail... - by El Forum - 04-23-2009, 10:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB