Topic: [solved] phpmailer - settings for mailing via ajaxpopform

I've integrated a ajax pop form into my test site
http://punbb-a.keydogbb.info/index.php
bottom right corner

taken from
http://www.brightyoursite.com/blog/2010 … axpopform/

now I don't understand how the sending of the email will work -
a. should I  try and get the phpmailer sending it and seperately configured   or
b. is there some way to use the forums mailer?

any pointers appreciated

Re: [solved] phpmailer - settings for mailing via ajaxpopform

You can use the forum_mail function.

Re: [solved] phpmailer - settings for mailing via ajaxpopform

Thanks.

The original uses this contact.php code which is called from ajaxpopform.js here.

Contact.php uses
function validEmail($email)

$to = 'keydog@keydogbb.info';
$subject = 'Test  ajaxpop form';
$from = $_POST['email'];
$msg=$_POST['message'];

Not really sure how this will relate to the email.php of punbb...
Do I need to include  email.php in contact.php or is it enough replacing 
function validEmail($email)    with
function forum_mailer($to, $subject, $message, $reply_to_email = '', $reply_to_name = '')

Re: [solved] phpmailer - settings for mailing via ajaxpopform

Apparently validEmail() checks if the e-mail is correct.

The forum_mail() function is an improved version of the usual mail() function in PHP. mail() is used in your code:

if(mail($to, $subject, $message, "From: $from  \r\nContent-type: text/html\r\n"))

I think it's OK. So you don't need forum_mail().

As I see, the Ajax request goes to http://keydogbb.info/extensions/ajaxpopform/contact.php, and this url is unavailable.

Re: [solved] phpmailer - settings for mailing via ajaxpopform

Parpalak wrote:

As I see, the Ajax request goes to http://keydogbb.info/extensions/ajaxpopform/contact.php, and this url is unavailable.

100% correct. That's where my prob was (configured ajaxpopform with keydogbb.info instead of punbb-a.keydogbb.info! Now it works without any other changes.
Thanks a lot.