CodeIgniter Forums

Full Version: Email Issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I'm creating a site, and currently just have a basic holding page with an email subscription form.  I'm hosting the site locally on a LAMP Stack for development, with a host for Production.

The current flow of events is...

User fills out 1 field form supplying email address.
Controller builds an email and sends it to admin email confirming a new subscriber
Controller writes the email address to a simple database table - done so via a Model function.
Controller builds an email and sends it to new subscriber confirming subscription.
User is shown a success page.

On my localhost, everything works as expected, and 2 emails are received - its very simply after all.  It's using the Codeigniter build in email class.

But after uploading everything to the host (and changing the necessary host specific variables), every works EXCEPT sending the FIRST email, so only 1 email received and no errors are reporting in the log (with log threshold set to 1).  I've tried adding in a $this->email->clear() but no change!

If no email worked, or data wasn't written, then I would have said it was a configuration difference between localhost and webhost, but the fact that SOME of it works has gotten me a little baffled.

Anyone got any suggestions?  I'm happy to post code if people need to see it, I just didn't want to flood the post with stuff if someone knows exactly whats going on without needing to see it.

Thanks in advance!

DC
Sounds like it maybe flagging it as a duplicate email and not sending it.

Are the email address the same?
Hi - thanks for your reply - I've figured it out!

My localhost was using my Gmail account SMTP to send and receive emails - all worked fine because essentially the emails were sent within the SMTP server, so instantly from outbox to inbox.

When I moved to the host, emails were handled by the hosts SMTP - I had setup my personal Gmail account to send/receive the emails from the host SMTP, maintaining the send from email address as the host rather than my gmail, for convenience so that I receive all my emails in one place. What I had failed to do was setup Gmail to RECEIVE emails from the host SMTP, so I was getting the 1st Email from the SMTP to my personal Gmail when I tested the form, but Gmail wasn't fetching the Email to the host SMTP.....so it was being sent, just not getting all the way thru to my gmail account.

D'oh! This is a result of trying to get everything done late at night when you've only got one left eye open! You live and learn!

Thanks again for your assistance and taking the time to reply - it is VERY much appreciated!!

DC
Your welcome, glad you figured it out.