Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

Sending email Using asp

 
webmaster forum
hardy  Offline
Activity
0%
 
New Coder
Posts: 25
Topics: 16
December 17, 2008, 10:51:23 PM

I have heard that we can use cdonts component to send email using asp, can anyone tell me where will I get code so that I can make contact us form in asp which sends email to me when user submit a form?

Thanks
 
webmaster forum
Kailash  Offline
Activity
0%
 
New Coder
Posts: 31
Topics: 10
December 19, 2008, 12:31:52 PM

Yes, you can use CDONTS ASP component to send mail using ASP. Below is the sample code which you can use to send mail:
   
Code:
<%
      Set objMail = Server.CreateObject("CDONTS.NewMail")

      objMail.To = “Name <email@domain.com>”
      objMail.From = “Name<email@domain.com>”
      objMail.Subject = “CDONTS Sample Script”

      BodyText = “This is a test email.” & vbCRLF
      BodyText = BodyText & “It was sent using CDONTS”  & vbCRLF
      BodyText = BodyText & vbCRLF

      objMail.Body = BodyText
      objMail.AttachFile “c:\attachfile.txt”  // For Attachment

      objMail.Send
%>

Also it is recommended you validate all input values before it send mail.

Kailash
 
webmaster forum
Anchor  Offline
Activity
0%
 
New Coder
Posts: 20
Topics: 16
January 11, 2009, 09:53:17 AM

I'm guessing the emails are getting flagged as spam because that's exactly what they are? lol
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
January 11, 2009, 10:48:38 AM

I'm guessing the emails are getting flagged as spam because that's exactly what they are?

I suppose it depends on what they use the script for - if the OP wants to allow his website visitors to send him a message then he can always tweak his junk filter to allow that sort of message to arrive

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Jennifer Linn
Activity
0%
 
New Coder
Location: UK
Gender: Female
Age: 26
Posts: 22
Topics: 5
WWW
March 16, 2009, 10:48:39 PM

Code:

Sub SendMailCDONTS(aTo, Subject, TextBody, aFrom)
  Const CdoBodyFormatText = 1
  Const CdoBodyFormatHTML = 0
  Const CdoMailFormatMime = 0
  Const CdoMailFormatText = 1
  Dim Message 'As New cdonts.NewMail
  
  'Create CDO message object
  Set Message = CreateObject("cdonts.NewMail")
  With Message
    
    'Set email adress, subject And body
    .To = aTo
    .Subject = Subject
    .Body = TextBody
    
    'set mail And body format
    .MailFormat = CdoMailFormatText
    .BodyFormat = CdoBodyFormatText
    
    'Set sender address If specified.
    If Len(aFrom) > 0 Then .From = aFrom
    
    'Send the message
    .Send
  End With
End Sub



Sending email using CDOSYS

Code:

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>

« Last Edit: July 12, 2011, 10:16:53 PM by Admin »

Service Management Software
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
March 19, 2009, 12:40:37 PM

Excellent, thanks for posting that Smiley

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Activity
0%
 
New Poster
Posts: 10
Topics: 2
March 03, 2010, 07:06:07 AM

great----------- thanks for sharing this thread. 
 
webmaster forum
singam  Offline
Activity
0%
 
Regular Coder
Posts: 50
Topics: 19
July 15, 2010, 03:42:03 AM

Well, you can make your form manually in HTML, Javascript, PHP. But once you SUBMIT your form, all the information in it has to be processed on the server (either if you need to store info on a db, or whatever the case.)
If your issue consists in not using PHP, then you can use ASP.NET, or ASP, etc; but you have to use a server platform to process your forms.

In this case, you say it's a contact form, that's you write a mail then you submit the form a mail address. In a normal situation, when you submit that form, another server page (i.e. made in PHP) usually takes that info (username, destination address, subject, mail content) and calls server functions to send the mail. That kind of things can't be done in Javascript because Javascript runs on people's browsers. Javascript is client-side. PHP, ASP, ASP.NET, are server-side.
=================

New Homes | Cheap Flights

 
webmaster forum
Corrinla  Offline
Activity
0%
 
New Coder
Posts: 28
Topics: 0
January 14, 2011, 11:49:16 PM

Below is the sample code which you can use to send mail:

pandora jewelry | wholesale
 
webmaster forum
Kayden  Offline
Activity
0%
 
New Poster
Posts: 1
Topics: 0
January 26, 2011, 10:49:40 PM

Have you tried to search I google I think you can found some codes that you can use in sending email using asp.  However, I have known some sample codes of asp that can use in sending email using asp.  Hope this will on your problem.
Code:
<%
Set myMail=CreateObject("CDO. Message")
myMail. Subject="Sending email with CDO"
myMail. From="mymail@mydomain. com"
myMail. To="someone@somedomain. com"
myMail. TextBody="This is a message. "
myMail. Send
set myMail=nothing
%>
xxx. w3schools. com/asp/asp_send_email. asp

 
webmaster forum
Activity
0%
 
Regular Coder
Gender: Male
Age: 24
Posts: 60
Topics: 10
July 11, 2011, 11:32:11 PM

This code will definitely help you

Code:

<%
'Sends an email
Dim mail
Set mail = Server.CreateObject("CDO.Message")
mail.To = Request.Form("To")
mail.From = Request.Form("From")
mail.Subject = Request.Form("Subject")
mail.TextBody = Request.Form("Body")
mail.Send()
Response.Write("Mail Sent!")
'Destroy the mail object!
Set mail = nothing
%>

« Last Edit: July 12, 2011, 10:17:18 PM by Admin »

Payday loan
 
webmaster forum
kellylsn  Offline
Activity
0%
 
Professional Coder
Posts: 229
Topics: 7
July 18, 2011, 11:20:26 PM

I think this code will partly help you.
<%
Dim ObjSendMail
Dim iConf
Dim Flds
     
Set ObjSendMail = Server.CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
     
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
     
'**** Path below may need to be changed if it is not correct
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
Flds.Update
     
Set ObjSendMail.Configuration = iConf
ObjSendMail.To = "someone@someone.net"
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = "someone@someone.net"
     
' we are sending a text email.. simply switch the comments around to send an html email instead
'ObjSendMail.HTMLBody = "this is the body"
ObjSendMail.TextBody = "this is the body"
     
ObjSendMail.Send
     
Set ObjSendMail = Nothing
%>

Payday Loan
Online Easy Loans
 
webmaster forum
dianna  Offline
Activity
0%
 
Regular Coder
Posts: 88
Topics: 10
WWW
August 04, 2011, 07:49:35 PM

Sending an HTML e-mail:
Code:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.HTMLBody = "<h1>This is a message.</h1>"
myMail.Send
set myMail=nothing
%>

Pakistan's Local Search engine
 
webmaster forum
Activity
0%
 
New Poster
Posts: 1
Topics: 0
August 23, 2011, 01:10:34 AM

You have helped me to improve my knowledge about this field.  Thank you so much for sharing.
 
webmaster forum
Life Is Good!
Activity
0%
 
Professional Coder
Gender: Female
Posts: 242
Topics: 3
WWW
August 23, 2011, 10:04:29 AM

this seems too difficult to understand.. Sad

Affordable Custom Web Design Services
 
webmaster forum
elizas186  Offline
Activity
0%
 
New Poster
Posts: 1
Topics: 0
December 09, 2011, 07:01:29 AM

hello every one
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page January 09, 2012, 09:13:53 PM