Codeigniter contact form email

后端 未结 2 825
名媛妹妹
名媛妹妹 2021-01-28 17:15

I\'m trying to set up a contact form in Codeigniter (I\'m running on xampp using Apache and I have a virtual host set up). I have the actual form working but when I try to link

2条回答
  •  旧巷少年郎
    2021-01-28 17:40

    As it turns out a number of factors seem to have contributed to this problem. First, I needed to configure some PHP settings, second certain email addresses were blocking the connection (gmail and live mail) so I switched to using an email address on a domain I own which was fine, and finally, just to make things interesting my email account was having technical problems which have now been resolved resulting in about 20 test messages being sent through this morning.

    What I did;

    In Xampp/PHP/php.ini:

    uncomment sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t", the comment out the next instance of sendmail_path.

    uncomment extension=php_openssl.dll

    Go into Xampp/sendmail/sendmail.ini:

    Go to smtp_server and set to your smtp extension (smtp.yourdomain.com) a few lines under this will be a section for username and password. Set this to the username and password for your email account.

    I also used the following program within a controller to check that all relevant ports were open:

    \n";
        else
            echo "www.google.com -  ok
    \n"; $fp = fsockopen("smtp.yourdomain.com", 465, $errno, $errstr, 10); if (!$fp) echo "smtp.yourdomain.com 465 - $errstr ($errno)
    \n"; else echo "smtp.yourdomain.com 465 - ok
    \n"; $fp = fsockopen("smtp.yourdomain.com", 587, $errno, $errstr, 10); if (!$fp) echo "smtp.yourdomain.com - $errstr ($errno)
    \n"; else echo "smtp.yourdomain.com - ok
    \n"; $fp = fsockopen("smtp.yourdomain.com", 25, $errno, $errstr, 10); if (!$fp) echo "smtp.yourdomain.com - $errstr ($errno)
    \n"; else echo "smtp.yourdomain.com 25 - ok
    \n"; } }

提交回复
热议问题