If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
How to configure E-mail configuration with SMTP  XML
Forum Index » Support Forum
Author Message
Frits
Newbie

Joined: 30/11/2008 18:10:23
Messages: 3
Offline

I'm very pleased with the possibilities of Advanced Buestbook 2.4.3. The only problem I've is the e-mail function.
My website is hosted on a Windowsserver with SMTP mailfunction. I've already removed .htaccess but the mailfunction is not operating at all. Other functions (upload, message display etc) is working fine.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

You need to speak to your hosts.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Frits
Newbie

Joined: 30/11/2008 18:10:23
Messages: 3
Offline

Thank you for your reaction but what do I have to ask my host? Other programs from my website are running fine with SMTP mailfucntion, why not Advanced Guestbook?
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Advanced Guestbook does not support SMTP sending. Some hosts recommend alternate scripts for using instead of the PHP mail() function so ask them if they have a opreference.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Frits
Newbie

Joined: 30/11/2008 18:10:23
Messages: 3
Offline

I've a working mailform.php on my website:
<?php
/* * * * * * * * * * * * * * SEND EMAIL FUNCTIONS * * * * * * * * * * * * * */


function authmailform($action, $email, $fname, $lname, $cname, $telno, $comments)
{
//SMTP + SERVER DETAILS
/* * * * CONFIGURATION START * * * */
$smtpServer = "mail.mywebsite.nl";
$port = "25";
$timeout = "30";
$username = "mail@mywebsite.nl";
$password = "xxxxxxxxx";
$localhost = "localhost";
$newLine = "\r\n";
/* * * * CONFIGURATION END * * * * */

//Connect to the host on the specified port
$smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
$smtpResponse = fgets($smtpConnect, 515);
if(empty($smtpConnect))
{
$output = "Failed to connect: $smtpResponse";
return $output;
}
else
{
$logArray['connection'] = "Connected: $smtpResponse";
}

//Request Auth Login
fputs($smtpConnect,"AUTH LOGIN" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authrequest'] = "$smtpResponse";

//Send username
fputs($smtpConnect, base64_encode($username) . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authusername'] = "$smtpResponse";

//Send password
fputs($smtpConnect, base64_encode($password) . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authpassword'] = "$smtpResponse";

//Say Hello to SMTP
fputs($smtpConnect, "HELO $localhost" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['heloresponse'] = "$smtpResponse";

//Email From
fputs($smtpConnect, "MAIL FROM: $email" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['mailfromresponse'] = "$smtpResponse";

//Email To
fputs($smtpConnect, "RCPT TO: $email" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['mailtoresponse'] = "$smtpResponse";

//The Email
fputs($smtpConnect, "DATA" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['data1response'] = "$smtpResponse";

//Construct Headers
$headers = "Content-type: text/plain".$newLine;
//$headers = "MIME-Version: 1.0" . $newLine;
//$headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
$headers .= "To: $lname <$email>" . $newLine;
$headers .= "From: $lname <$email>" . $newLine;

//fputs($smtpConnect, "To: $to\nFrom: $from\nSubject: $subject\n$headers\n\n$message\n.\n"); unix
fputs($smtpConnect, "To: $email".$newLine."From: $email".$newLine."Subject: $telno".$newLine."$headers".$newLine.$newLine."$comment".$newLine.".".$newLine); // windows
$smtpResponse = fgets($smtpConnect, 515);
$logArray['data2response'] = "$smtpResponse";

// Say Bye to SMTP
fputs($smtpConnect,"QUIT" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['quitresponse'] = "$smtpResponse";

return TRUE;
//print_r($logArray);
}

//pas de onderstaande variabelen aan naar jouw wensen
$adminaddress = "mail@mywebsite.nl";
$siteaddress ="http://www.mywebsite.nl";
$sitename = "mywebsite.nl";

//hieronder hoeft in principe niets ge-edit te worden...


// Haalt de tijd en de datum van de server
$date = date("m/d/Y H:i:s");


// Haalt de informatie dat gepost is door Flash
$action = $HTTP_POST_VARS['action'] ;
$email = $HTTP_POST_VARS['email'] ;
$fname = $HTTP_POST_VARS['fname'] ;
$lname = $HTTP_POST_VARS['lname'] ;
$cname = $HTTP_POST_VARS['cname'] ;
$telno = $HTTP_POST_VARS['telno'] ;
$comments = $HTTP_POST_VARS['comments'] ;

//De informatie uit de tekstbalken (de variabelen) wordt gestructureerd naar jouw email adres gestuurd.

if ($action == "send") {
//hieronder kan de tekst worden aangepast
//een harde enter wordt weergegeven als /n
//alles na een $-teken is een variabele
mail ("$adminaddress","Info Request",
"Een bezoeker van $sitename heeft het volgende bericht achtergelaten\n
Voornaam: $fname
Achternaam: $lname
Email: $email
Bedrijf: $cname
Telefoon: $telno\n
Bericht van $fname $lname:
______________________________

$comments



______________________________

Date/Time: $date","FROM:$adminaddress" ) ;


//De verzender van de email krijgt automatisch een bedankje
//deze tekst is ook aan te passen.
mail ("$email","Dank u voor het bezoeken van $sitename",
"Geachte heer/mevrouw $lname,\n
Dank u voor uw interesse in $sitename.\n
Uw mail wordt zo snel mogelijk in behandeling genomen.\n
\n
Met vriendelijke groet,\n
mywebsite
","FROM:$adminaddress"
) ;

//Deze bevestiging wordt naar Flash gestuurd als alles is afgerond.
$sendresult = "Dank u wel. U ontvangt binnen enkele seconden een bevestigingsmail.";
$send_answer = "answer=";
$send_answer = rawurlencode($sendresult);
echo $send_answer;


}
?>

Can I use this? Where do I place this file/code?
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

www.carbonize.co.uk/smtp.zip

Edit the agsmtp.php file and upload it the guestbook folder then replace the add.class.php file in your lib folder with the new one.

Not tested it and have no intentions of testing it.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum