We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

[SOLVED] Setting "From" email address | Forum

dave Leader
dave Apr 28 '15
remember now this is not Oxwall ok, im talking a basic php mail send here, i just wanted to show you an example so you could get an idea of how a basic one works.  That example i showed you is from a contact form (a basic one) like this one 

http://www.icodemods.com/contact.php


so the user puts their email in the input field and that is where the $from comes from. 


There should not be any issue with your php mailer for oxwall as it works for me so if your changing the mailer put it back the way it was, its not working for some other reason ok.  


The Forum post is edited by dave Apr 28 '15
James Geddes
James Geddes Apr 30 '15
I'm not sure what's going wrong for me then, I've just set my $From in "class.phpmailer.php" to "hq@geek.zone" and it's just ignoring it and using the default address of jamesge1@just79.justhost.com


What do you suggest I check?


Thanks :)

The Forum post is edited by James Geddes Apr 30 '15
dave Leader
dave Apr 30 '15
if it is changing the email address then it is grabbing it after the php mailer class has been executed, it probably grabs the email address right after that from the db and im not familiar with it enough to know exactly and this is just a guess. But logically it makes sense. 
James Geddes
James Geddes May 1 '15
So what do I have to do in order to fix it?
dave Leader
dave May 1 '15
honestly i dont know, there should not be any reason to have to fix anything im not sure why your having an issue James, i dont have any issue with mine.  Must be a server issue maybe i honestly dont know man. 
James Geddes
James Geddes May 1 '15
I have now tried adding -f in php.ini so that it looks like this


sendmail_path = /usr/sbin/sendmail -t -i -f hq@geek.zone


However when I do this, oxwall returns the attached exception on user signup


What is going wrong?


Thanks!

The Forum post is edited by James Geddes May 1 '15
Attachments:
  mailexception.jpg (101Kb)
James Geddes
James Geddes May 1 '15
I have just tried this line


sendmail_path = /usr/sbin/sendmail -t -i -fhq@geek.zone


but that returns the attached exception when someone registers


Am I doing something wrong? What can I check?

Attachments:
  mailexception2.jpg (115Kb)
James Geddes
James Geddes May 1 '15
Could it be linked to the known bug?


http://is.gd/PnbMoN


I had to implement the fix at the bottom of that page

James Geddes
James Geddes May 1 '15
SOLVED!!!


Turns out this is partially an issue with JustHost (and perhaps other shared hosting providers with similar setups) and partially an issue with php.ini


General solution:


1. Create the from address

Even if your emails do not run via your hosting provider, ensure that the from email exists on their system


2. Edit php.ini


3. Add -f'address@example.com' to sendmail_path


it should now look like this


sendmail_path = /usr/sbin/sendmail -t -i -f'address@example.com'


Where address@example.com is the email address you want to use




If you are using a hosting account that has with multiple addon domains (or similar):


1. Create the from address

Even if your emails do not run via your hosting provider, ensure that the from email exists on their system


2. Copy php.ini from the root public_html directory into the site directory


3. Edit php.ini


4. Add -f'address@example.com' to sendmail_path

it should now look like this


sendmail_path = /usr/sbin/sendmail -t -i -f'address@example.com'


Where address@example.com is the email address you want to use


5. Add the following to the top of the sites .htaccess file

AddHandler application/x-httpd-php54 .php


DONE!!!


I think, touch wood, that was my last setup bug.

The Forum post is edited by James Geddes May 1 '15
dave Leader
dave May 1 '15
Thanks for sharing James, glad you got it worked out, happy for you man :)
Pages: « 1 2