Solved

multiple lines in text body

Posted on 2004-10-07
5
2,985 Views
Last Modified: 2007-12-19
I am trying to send a message using CDO, I receive the password but not the alias,
here is my code :-

Set oMail = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup"
iConf.Fields.Update
Set oMail.Configuration = iConf
oMail.To             = "Email"
oMail.From       = "me@here.com"
oMail.Subject       = "Welcome to our member section!"
oMail.TextBody       = "Your Password is: " & PasswordTemp  & vbCrLf
oMail.TextBody           = "Your Alias is: " & user  & vbCrLf

oMail.Send
Set iConf = Nothing
Set Flds = Nothing

appreciate any help
0
Comment
Question by:kajamy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Barry62
ID: 12248300
Well, if you are getting the password back, then CDO is working fine.  I think you need to show more of your script.  Where do you populate the 'user' variable?

Barry62
0
 

Author Comment

by:kajamy
ID: 12250194
This is my script :-

useraction = request("action")
select case useraction
case "login"
'generate the function
PasswordTemp = rndit()
'collect data from form
Alias = request.form("Alias")
Email = request.form("Email")
Age = request.form("Age")
'response.write Alias & Email & Age & rndit'***debug
'database objects
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
'sql query
sql = "select Password from users where Password='"&PasswordTemp&"' or Alias='"& Alias & "' or Age='"& Age & "'"
Conn.Open dsn
rs.open sql,conn
if rs.eof and rs.bof then
sql1 = "insert into users (Alias,Password,Age,Email) values('"& Alias & "',"& PasswordTemp & ",'"& Age & "', '"& Email & "')"
conn.execute(sql1)
response.write "<script>alert('you registered succefully');location.href='index.asp';</script>"


       
Set oMail = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup"
iConf.Fields.Update
Set oMail.Configuration = iConf
oMail.To             = "Email"
oMail.From             = "me@here.com"
oMail.Subject       = "Welcome to our member section!"
oMail.TextBody       = "Your Alias is: " & Alias  & vbCrLf
oMail.TextBody  = "Your Password is: " & PasswordTemp  & vbCrLf

oMail.Send
Set iConf = Nothing
Set Flds = Nothing

            else
response.write "<script>alert('Alias already exists');</script>"
                  
            end if
            
rs.close
set rs = nothing
conn.close
set conn = nothing

end select
%>      

0
 
LVL 8

Accepted Solution

by:
Barry62 earned 50 total points
ID: 12250328
Ah, I should have seen it before!

you have:

oMail.TextBody      = "Your Alias is: " & Alias  & vbCrLf
oMail.TextBody  = "Your Password is: " & PasswordTemp  & vbCrLf


You are redefining oMail.TextBody.  What you need is this:

oMail.TextBody      = "Your Alias is: " & Alias  & vbCrLf
oMail.TextBody  = oMail.TextBody & "<br><br>Your Password is: " & PasswordTemp  & vbCrLf


Barry62
0
 

Author Comment

by:kajamy
ID: 12250822
Cool tried that the message now reads :-

Your Alias is:
Your Password is: 500118

I  removed the <br> as they are not necessary.

any idea why the password doesn't show up?
0
 

Author Comment

by:kajamy
ID: 12250882
Ok tried it in reverse and got :-

Your Password is: 953701
Your Alias is:

so it's my variables that are wrong
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question