Welcome Guest, Not a member yet? Register   Sign In
Sending mails failing
#1

[eluser]bhakti.thakkar[/eluser]
hi all,

i am trying to send mails once the required details and validations are done

Code in Controller: register.php

Code:
$this->load->library('email');

$email_body = " Relation ID SI: ".$Relation_ID." has requested for a username and password <br> Kindly do the needful. ";
$config['mailtype'] = 'html';
$this->email->initialize($config);
$senderInfo = " MY COMPANY ";
$this->email->to("[email protected]");
$this->email->from("[email protected]", "Bhakti Thakkar");
$this->email->subject("New registration request");
$this->email->message($email_body);
$this->email->send();

But somehow my mails are not sent. i have yet changed anything in config/Email.php. this is just a test mail which i am trying to do. where is my code failing
#2

[eluser]bastones[/eluser]
Can you add the following code to the bottom and post the results:

Code:
echo $this->email->print_debugger();
#3

[eluser]bhakti.thakkar[/eluser]
Hi,
This is what i get when i do:
echo $this->email->print_debugger();


Code:
Your message has been successfully sent using the following protocol: mail

User-Agent: CodeIgniter
Date: Mon, 10 Nov 2008 09:50:53 +0530
From: "Bhakti Thakkar"
Return-Path:
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4917b6a54f384"
This is a multi-part message in MIME format.
Your email application may not support this format.

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

Relation ID SI: 1 has requested for a username and password for Client
information system. Kindly do the needful.


--B_ALT_4917b6a54f384
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
New registration request
Relation ID SI: 1 has requested for a username and password for Client inf=
ormation system. <br> Kindly do the needful.

--B_ALT_4917b6a54f384--

Can anyone figure it why mail doesnt actually come?

Thanks
#4

[eluser]Bluemill Media[/eluser]
UPDATED: I'm having a similar problem, though mail only seems to fail with certain mail services, such as hotmail, and possibly Yahoo, but works with gmail. It is now also able to deliver to POP addresses... Seems the problem only exists with an (as of yet) undefined list of web-mail service providers.

Can anybody imagine a reason this would be occurring? I'm on a tight deadline and breaking my head trying to debug this issue. Sad

Here's my code if it's relevant (platform identifying strings replaced with PLATFORM_NAME):

Code:
$EmailConfig = array(
    'useragent' => 'PLATFORM_NAME',
    'mailtype' => 'html',
    'useragent' => 'PLATFORM_NAME',
);
$this->email->initialize($EmailConfig);

$MessageBody = $this->load->view('email/reg_confirm', $UserData, TRUE);

$this->email->from('support@PLATFORM_NAME.com', 'PLATFORM_NAME Welcome Team');
$this->email->to($this->validation->Email);
$this->email->subject('Welcome To PLATFORM_NAME!');
$this->email->message($MessageBody);
$this->email->send();
#5

[eluser]leafc[/eluser]
I have a same issue.

I get no error but no mail is sent.

here is my code:
=============================================================
Code:
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);

$from_name = 'test';
$from_email = '[email protected]';
$to = '[email protected]';
$subject = 'test subject';
$body = "this is test mail";

$this->email->from($from_name, $from_email );
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($body);
$this->email->send();
        
echo $this->email->print_debugger();
=============================================================


=============================================================
Code:
Your message has been successfully sent using the following protocol: sendmail

User-Agent: CodeIgniter
Date: Thu, 19 Feb 2009 22:23:27 +0200
From: "[email protected]"
Return-Path:
To: [email protected]
Subject: test subject
Reply-To: "test"
X-Sender: test
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <499dbfbfb66f6>
Mime-Version: 1.0


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

this is test mail
=============================================================


but I don't recieve any mail and I am not using free account mail address.
what am I doing wrong here?
#6

[eluser]brianw1975[/eluser]
The good thing is that you are probably not doing anything wrong with your code. The bad part is that you may be running into something that really SUCKS (sometimes) to have to fix yourself or get your hosting provider to fix.

Check and see if you have a DomainKey set up for your mail domain - i had a HUGE problem with this and Hotmail accounts when it was first put in place.

You want to look here http://antispam.yahoo.com/ and http://domainkeys.sourceforge.net/

Hotmail has this tendency to just drop emails that come from a domain without a DomainKey - i mean drop as in "gone, do not pass go, do not go to jail, do not collect $200 and no, you will not get a bounce as undeliverable" - just gone.

Hopefully I am wrong, so good luck.
#7

[eluser]gh0st[/eluser]
I've noticed that the email class never sets the return path in my tests.

I've noticed it in your debug output to ... also, why is "from" never showing the actual email address?

Quote:From: "EXAMPLE SITE"
Return-Path:
#8

[eluser]leafc[/eluser]
Thank you for the comments.

>gh0st
How can I set "Return-Path:"?
#9

[eluser]Jay Logan[/eluser]
I just ran into the same problem. The way I fixed it was switch to SMTP. First create an e-mail account to send from. I created a dummy noreply account on my server. Then enter your SMTP log in info into CI. That should send the e-mails. Hope that helps.
#10

[eluser]leber[/eluser]
i once had a similar issue, solved it by changing the encoding from 8-bit to 7-bit...dunno why, but it worked for me.




Theme © iAndrew 2016 - Forum software by © MyBB