Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 04-27-2006, 12:14 PM CDOSYS Mail Help
Experienced Talker

Posts: 38
Trades: 0
Hi,

I am using the following code to send mails

<%


Const cdoSendUsingPort = 2
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With

Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
With MyMail
.Configuration = iConf
.From = "jim@jim.com"
.To = Request("sendto")
.Subject = "Subject"
.TextBody = Request("body")
.Send()
End With
Set MyMail = Nothing


%>

Now this all works fine but i would like to include a footer within the email body but am not sure how i go about this? I have tried things like...

.TextBody = Request("body") & "email from your website"

that sent but it did not include the email from your website bit. I am quite new to this and any help would be greatly appreciated.

Thanks,

James
phreakyphonez is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-27-2006, 01:50 PM Re: CDOSYS Mail Help
Experienced Talker

Posts: 38
Trades: 0
Also tried this for the number but this also does not work

Dim Number

Number = Request("sendto")
Number = Number & "@myemailsmsnotification.com"

and it does not deliver??
phreakyphonez is offline
Reply With Quote
View Public Profile
 
Old 04-27-2006, 10:09 PM Re: CDOSYS Mail Help
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
What happens when you response.write Number after the second line (the & "@myemailsmsnotification.com" line?)

As far as the other code goes, I'd try concatenating the two things into an Email_Body variable, and setting .TextBody to Email_Body .
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 04-28-2006, 04:36 AM Re: CDOSYS Mail Help
Experienced Talker

Posts: 38
Trades: 0
Thats what i have done for the Number variable. I want it so that i can type in my number on the a form and then it will send to this code attachtin an email address to the number. I'm not too bothered about the TextBody at the moment. But that should have worked.. shouldnt it?
phreakyphonez is offline
Reply With Quote
View Public Profile
 
Old 04-28-2006, 07:09 AM Re: CDOSYS Mail Help
Experienced Talker

Posts: 38
Trades: 0
Could someone please tell me where i am going wrong with this?? it looks like it should deliver to me but it's not attaching the e-mail address to the sendto.. completey confused


<%


Const cdoSendUsingPort = 2
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With

Dim MyMail
Dim Number

Set MyMail = Server.CreateObject("CDO.Message")
With MyMail




Number = Request("sendto")
Number = Number & "@example.com"


.Configuration = iConf
.From = "SMS@Notification.com"
.To = Number
.Subject = "Subject"
.TextBody = Request("body")
.Send()
End With
Set MyMail = Nothing


%>
phreakyphonez is offline
Reply With Quote
View Public Profile
 
Old 04-28-2006, 11:53 AM Re: CDOSYS Mail Help
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
phreakyphonez: I don't think you understood me. My bad for not making it clear, though.

First off, you really shouldn't use the variable Number anyway, since it's a reserved word (Phone_Number would be better).

Second, you've got two lines where the Phone_Number variable are concatenated. Have you tried using Response.Write Phone_Number to see what the resulting email is that's created? This way, you can see what's being created vs. what you expect. Response.Write is great that way if you use it.

The other issue pertains to SMS. If you're using a phone number to send text messages to and an email protocol to do it, it may not work (I don't know, though...I've never tried.) What happens when you use an ordinary email?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-04-2006, 07:47 AM Re: CDOSYS Mail Help
Experienced Talker

Posts: 38
Trades: 0
Hi Adam. I did get it working fine but yes i think i will change Number to something else. Thanks for your help on this, greatly appreciated.
phreakyphonez is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CDOSYS Mail Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18665 seconds with 12 queries