![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| Hi All, I'm going to be creating a new form using asp that will update a sql database but would like to know what is a simple way to email the form info using ASP. I've googled but found only in php. Should send email at the same time of updating the database..... Thanks in advance for your help! Last edited by Rebelle; July 14th, 2008 at 11:18 AM. |
| Sponsored Links |
|
#2
| |||
| |||
| You need to know what system your site is hosted on, Windows or Linux as the methods are different, also you can check out you hosts FAQ and see what method they say for sending mail. |
|
#3
| ||||
| ||||
| Belle - Run this script on your server to see which of these common mail components you have: http://www.developerbarn.com/classic...nent-test.html Once you know what component you have available, do a Google search on that specific component to learn how to use it.
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.Join our Folding team: DeveloperBarn Folding |
| The Following User Says Thank You to jmurrayhead For This Useful Post: | ||
Rebelle (August 14th, 2008) | ||
|
#4
| |||
| |||
| If your on a Windows based host you should be able to use Code:
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "SMTP SERVER ADDRESS"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/con...smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 60
objCDOSYSCon.Fields.Update
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = strFromName & " <" & strFromEmail & ">"
objCDOSYSMail.Cc = strFromName & " <" & strFromEmail & ">"
objCDOSYSMail.To = strToEmail
objCDOSYSMail.Subject = strSubject
objCDOSYSMail.HTMLBody = strBody
objCDOSYSMail.Send
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
|
| The Following User Says Thank You to icoombs For This Useful Post: | ||
Rebelle (August 14th, 2008) | ||
|
#5
| ||||
| ||||
| okies....thanks, this is what the result is....I'll google away. Testing CDONTS mail component... This component is available on this server. Testing JMail component... This component is not available on this server. Testing ASPEmail component... This component is not available on this server. Testing CDO mail component... This component is available on this server. |
|
#6
| ||||
| ||||
| In that case, here's a very simple example: 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
%>
|
|
#7
| ||||
| ||||
| Hiya, I tried the code in post above but running into the following error: Code: CDO.Message.1 error '80040220' The "SendUsing" configuration value is invalid. or is this error something else I'm doing incorrectly? ![]() Line in red. Code: Dim myMail
Set myMail = createObject("CDO.Message")
myMail.Subject="a new form has just been submitted"
myMail.From="xxx@company.com"
myMail.To="yyy@company.com"
myMail.TextBody="this is a test"
myMail.Send
Set myMail=nothing
Last edited by Rebelle; July 23rd, 2008 at 02:39 PM. Reason: added code for code in red! |
|
#9
| ||||
| ||||
| with icoombs example, i get the following error: Code: CDO.Message.1 error '80040213' The transport failed to connect to the server. is there another way i can test to see if email will work for my server? |
|
#10
| |||
| |||
| Check with your host, they may have a FAQ or you will have to contact them. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Basic Tools] An intro to making complex databases using simple methods. | sbenj69 | Microsoft Access | 3 | June 27th, 2008 12:09 AM |
| send Bulk email | peebman2000 | .Net Development | 2 | June 20th, 2008 10:06 AM |
| [ASP/VBScript] ASP/VBScript Simple Mail Component Test | jmurrayhead | Code Samples | 0 | March 20th, 2008 09:47 AM |