Make email in form the mailfrom addres

Questions and bug reports for current release of CKForms

Make email in form the mailfrom addres

Postby wills99 » Sun Nov 15, 2009 10:41 pm

I need the email address field in my form to be the "Mail From" address in the email form result so when I respond to the form result email, I do not have to copy/paste the address before replying.

There is another post that claims this functionality was added but I cannot find out how to do it.

Please help.
wills99
 
Posts: 6
Joined: Sun Nov 15, 2009 4:39 pm
Top

Re: Make email in form the mailfrom addres

Postby pbass98 » Tue Nov 17, 2009 10:28 pm

I also need this information-- we upgraded to the latest version specifically for this feature!

Thanks for a great component.
pbass98
 
Posts: 6
Joined: Tue Nov 17, 2009 10:24 pm
Top

Re: Make email in form the mailfrom addres

Postby wills99 » Tue Dec 01, 2009 1:26 am

Apparently nobody monitors this forum. It's a shame because it is a good component.
wills99
 
Posts: 6
Joined: Sun Nov 15, 2009 4:39 pm
Top

Re: Make email in form the mailfrom addres

Postby Samaroo » Mon Dec 07, 2009 8:44 pm

Hi,

Pedrino usually provides great support on this forum but I guess his time is preoccupied these days.

First please make sure that you have the latest version of ckforms:

- CKForms component 1.3.3 (build 5)
- CKForms plug-in 1.3.3 (build 3)
- CKForms module 1.3.3 (build 2)

Either do a full install or use the upgrade files.

Then Edit the form itself, not the fields, and click on the Email tab. You should be able to set the email address you want there.

Let me know if this helps.
Samaroo
 
Posts: 39
Joined: Thu Sep 03, 2009 2:28 pm
Top

Re: Make email in form the mailfrom addres

Postby wills99 » Thu Dec 10, 2009 2:13 am

I have the latest version and build. I have tried all sorts of entries in the Mail FROM field but no luck.

Image
wills99
 
Posts: 6
Joined: Sun Nov 15, 2009 4:39 pm
Top

Re: Make email in form the mailfrom addres

Postby hiddensphinx » Sat Dec 19, 2009 7:16 am

Here you go...a hack by yours truly :D

edit com_ckforms/models/ckforms.php

After Line 427 that reads

Code: Select all
$mailBody = $mailBody.JText::_( 'IP Address' ) . " : " . $_SERVER['REMOTE_ADDR'] . "<br/>\n";


insert

Code: Select all
         // Rahul Chand - Start Hack
         
         function get_emails ($str)
            {
            $emails = array();
            preg_match_all("/\b\w+\@\w+[\.\w+]+\b/", $str, $output);
            foreach($output[0] as $email) array_push ($emails, strtolower($email));
            if (count ($emails) >= 1) return $emails;
            else return false;
            }
            
         # Sample string containing email addresses;
         $str = $mailBody;

         # Get the emails on arrays;
         $emails = get_emails ($str);
         
         // Rahul Chand - End Hack


Edit Line 461 that reads

Code: Select all
$mail->setSender( array( $ckform->emailfrom, "" ) );


to

Code: Select all
$mail->setSender($emails); // Rahul Chand - Call Email address from above hack



Enjoy!!!!
Rahul Chand :D
hiddensphinx
 
Posts: 2
Joined: Sat Dec 19, 2009 7:10 am
  • Website
Top

Re: Make email in form the mailfrom addres

Postby wills99 » Tue Dec 22, 2009 3:44 pm

Thanks!!!! Works great.
wills99
 
Posts: 6
Joined: Sun Nov 15, 2009 4:39 pm
Top

Re: Make email in form the mailfrom addres

Postby Zuurpruim » Thu Jan 28, 2010 3:49 pm

hiddensphinx wrote:Here you go...a hack by yours truly :D
// Rahul Chand - Start Hack

function get_emails ($str)
{
$emails = array();
preg_match_all("/\b\w+\@\w+[\.\w+]+\b/", $str, $output);
foreach($output[0] as $email) array_push ($emails, strtolower($email));
if (count ($emails) >= 1) return $emails;
else return false;
}

Thank yoy, thank you
This works (partially)
When someone uses an emailaddrees with a dot in it, it losses the part in front of the dot. ( becomes .
I altered your code slightly and now it works flawless

Code: Select all
// Rahul Chand - Start Hack
         
         function get_emails ($str)
            {
            $emails = array();
            pregpreg_match_all('/(\w+\.)*\w+@(\w+\.)*\w+(\w+\-\w+)*\.\w+/', $str, $output);   
            foreach($output[0] as $email) array_push ($emails, strtolower($email));
            if (count ($emails) >= 1) return $emails;
            else return false;
            }
Zuurpruim
 
Posts: 1
Joined: Thu Jan 28, 2010 3:03 pm
Top

Re: Make email in form the mailfrom addres

Postby gregor_z » Mon Feb 01, 2010 10:34 am

Hi, can I get the whole code from this file. I did what you wrote and I get any e-mails.
gregor_z
 
Posts: 1
Joined: Mon Feb 01, 2010 10:32 am
Top

Re: Make email in form the mailfrom addres

Postby theblues » Mon Feb 01, 2010 8:30 pm

You will no doubt be able to help me ... I have a problem that seems simple but I can not solve ... I create more fields in my form (corresponding to several issues) but at the preview, only one appears ?????
Thank you for your response
theblues
 
Posts: 1
Joined: Mon Feb 01, 2010 8:28 pm
Top

Next

Return to CKForms 1.3.x Support forum

Who is online

Users browsing this forum: No registered users and 1 guest