Forums
This topic is locked
updating record and emailing changes
Posted 08 Feb 2005 00:38:02
1
has voted
08 Feb 2005 00:38:02 Javier Castro posted:
Hi, This is the scenario. A user logs in to my site, gets to the greeting section where he/she has the option to change his/her personal info, once the changes are done he/she can submit the info that is stored on an Access DB. What I need to do is to send that new information via email as soon as the person submits the changes.
So far I have been able to update the record and send the email, but in the body of the email i get nothing. Any clues as to why is that? Help please here is a sample of the code I have been trying to put into place:
<%
If (CStr(Request("MM_update"



set sysMail = Server.CreateObject("CDO.Message"

sysMail.Configuration.Fields("schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.server.com"
sysMail.Configuration.Fields("schemas.microsoft.com/cdo/configuration/sendusing") = 2
sysMail.Configuration.Fields("schemas.microsoft.com/cdo/configuration/sendusername") = ""
sysMail.Configuration.Fields("schemas.microsoft.com/cdo/configuration/sendpassword") = ""
sysMail.Configuration.Fields.Update
sysMail.Fields("urn:schemas:httpmail:importance"


sysMail.Fields.Update
sysMail.From = "myemail@goeshere"
sysMail.To = "recipientemail@goeshere"
sysMail.Subject = "The Following Member has updated his/her personal information"
if (cInt(Request("EmailType"

sysMail.TextBody = cStr(Request("MM_UserID, CompanyName, CompanyWebsite, Salutation, FirstName, LastName, TitlePosition, AddressLine1, AddressLine2, City, StateProvince, ZipPostCode, Country, TelephoneNo, Fax, UserEmail"

else
sysMail.HTMLBody = cStr(Request("CompanyName, CompanyWebsite, Salutation, FirstName, LastName, TitlePosition, AddressLine1, AddressLine2, City, StateProvince, ZipPostCode, Country, TelephoneNo, Fax, UserEmail"

end if
sysMail.Send
end if
%>
<%
Dim rsMail__MMColParam
rsMail__MMColParam = "1"
If (Request.QueryString("UserID"


rsMail__MMColParam = Request.QueryString("UserID"

End If
%>
<%
Dim rsMail
Dim rsMail_numRows
Set rsMail = Server.CreateObject("ADODB.Recordset"

rsMail.ActiveConnection = MM_connOENDB1_STRING
rsMail.Source = "SELECT CompanyName, CompanyWebsite, Salutation, FirstName, LastName, TitlePosition, AddressLine1, AddressLine2, City, StateProvince, ZipPostCode, Country, TelephoneNo, Fax, UserEmail FROM Users WHERE UserID = " + Replace(rsMail__MMColParam, "'", "''"

rsMail.CursorType = 0
rsMail.CursorLocation = 2
rsMail.LockType = 1
rsMail.Open()
rsMail_numRows = 0
%>
Replies
Replied 08 Feb 2005 10:38:07
08 Feb 2005 10:38:07 Lee Diggins replied:
Hi
I need to know what page this script resides on. Do you use the update behaviour on the form page then redirect to this page to send the email? If you do are you passing the UserID in the querystring?
If unsure post all your code from both the form page and any dependent pages.
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
Lee Diggins - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
I need to know what page this script resides on. Do you use the update behaviour on the form page then redirect to this page to send the email? If you do are you passing the UserID in the querystring?
If unsure post all your code from both the form page and any dependent pages.
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
Lee Diggins - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Replied 08 Feb 2005 15:38:35
08 Feb 2005 15:38:35 Javier Castro replied:
Hi Lee,
The script is on the update profile page. This is where the user can view their info and change it. What I'm trying to do is to make the submit button the trigger for the update and the e-mail. As I mention on my posting the sript does update and sends the email, but the body of the email does not show the new info. Now, I know this bunch of code looks messy but I'm new to this so, thanks for the patiente.
The script is on the update profile page. This is where the user can view their info and change it. What I'm trying to do is to make the submit button the trigger for the update and the e-mail. As I mention on my posting the sript does update and sends the email, but the body of the email does not show the new info. Now, I know this bunch of code looks messy but I'm new to this so, thanks for the patiente.
Replied 08 Feb 2005 18:06:27
08 Feb 2005 18:06:27 Lee Diggins replied:
Hi
Can you post the code from the whole page so I can see what happening?
Thanks.
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
Lee Diggins - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Can you post the code from the whole page so I can see what happening?
Thanks.
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
Lee Diggins - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>