?
Solved

multiple lines in text body

Posted on 2004-10-07
5
Medium Priority
?
3,046 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 200 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

Independent Software Vendors: 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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

770 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