clkung
|
Posted: 08/20/2003, 12:41 PM |
|
Hi Folks,
I like to know whether there is a sample of codes that I can used to automatically send an email message when someone make a new entry into a forum message or thread ? Thanks for any suggestion .
|
|
|
RonB
|
Posted: 08/21/2003, 2:22 AM |
|
You didn't state wich language you use. In PHP it's not that hard. i use the afterinsert event to get the information that was inserted and use it to send an email. Here's some code I use in a download account system. After the admin has created the account this info is sent to the customer and he or she can proceed with downlaoding a product:
$login_AfterInsert = true;
//End robbie_login_AfterInsert
//Custom Code @30-ABF9AC76
// -------------------------
global $login;
$to=$login->login->GetValue();
$pass=$robbie_login->password->GetValue();
$subject="Dowload account activation";
$message="Your payment has been received and a download account has been created.\n\n" ."Use the email provided by you on purchase as login and " .$pass ." as the password.\n\n" ."Your download account will be active for the next 48 hours. Please click the link to acces the download area:\n\n"
."http://www.somedomain.com/download.php \n\n" ."Thank you for your purchase,\n\n";
mail( $to,$subject,$message);
// -------------------------
//End Custom Code
//Close login_AfterInsert @2-50294810
return $login_AfterInsert;
}
//End Close login_AfterInsertHope this helps
Ron
|
|
|
clkung
|
Posted: 08/22/2003, 11:49 AM |
|
I am using ASP, does that make a lot of difference if using PHP ?
Thanks for your help. Are the codes the same in ASP ?
|
|
|
RonB
|
Posted: 08/23/2003, 12:43 AM |
|
I found this in another post on the forum. Hope it helps:
sub sendemail(email_from, email_to, email_subject, email_body, email_format)
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = email_from
objCDO.To = email_to
objCDO.Subject = email_subject
objCDO.Body = email_body
objCDO.BodyFormat = email_format
objCDO.MailFormat = email_format
objCDO.Send
set objCDO=Nothing
end sub
Ron
|
|
|
Karen
|
Posted: 08/23/2003, 1:22 AM |
|
If you are using CCS, you can try to add the 'Send Email' action in your event, e.g., AfterInsert. I've used it successfully with PHP and it's very easy to setup.
Hope this helps.
|
|
|
willieindallas
|
Posted: 08/24/2003, 9:03 AM |
|
I use cdonts email with asp and it works fine.Go to Custom code, then add code.
Dim ObjMail, strMsg
strMsg="Thanks for Using our Online BPO ordering system again. "& vbcrlf _
&"We Receive your order for the propety listed in Subject box. "& vbcrlf _
willie@ntrees.com. "& vbcrlf _
&"Thanks again, "& vbcrlf & vbcrlf _
&"Willie."
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
ObjMail.From = "Willie <email@email.com>"
ObjMail.To = Request.Form("emailAddress")
ObjMail.Cc = "willie@ntrees.com"
ObjMail.Subject = Request.form("propertyAddress")
ObjMail.Body = strMsg
ObjMail.Send
Set ObjMail = Nothing
|
|
|
|