Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Lionsanime Directory   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 06-30-2004, 09:05 AM   #1 (permalink)
Inactive
 
Join Date: 05-26-04
Posts: 13
iTrader: 0 / 0%
Latest Blog:
None

Butler Did It is liked by many
ASP Form Mail with Microsoft Exchange Server

I have been struggling with setting up a basic ASP form to email script. When attempting to include the SMTP, I was informed the client is using a Microsoft Exchange Server.

I have failed horribly by changing the values for 'referers' and 'smtpServer'. Do I need entirely different code or can this be tweaked?

Here are the form basics...
[code:1:e19983663c]<form action="scripts/form.asp" method="post">
<p>
<input name="_recipients" type="hidden" value="sales@komota.com" />
<input name="_requiredFields" type="hidden"
value="Name,Customer ID,Email,Comments" />
Name: <input name="Name" type="text" /><br />
Customer ID: <input name="Customer ID" type="text" /><br />
Email Address: <input name="Email" type="text" /><br />
Comments:<br />
<textarea name="Comments" rows=5 cols=50></textarea>
<input type="submit" value="Submit" />
<input type="reset" value="Clear" />
</p>
</form>[/code:1:e19983663c]

Here are the ASP basics...
[code:1:e19983663c] referers = Array("www.komota.com","komota.com")
mailComp = "ASPMail"
smtpServer = "mail.komota.com/exchange"
fromAddr = "sales@komota.com"[/code:1:e19983663c]

I was informed that the Exchange is being run on IIS 5 or 6 and it has an ISP of 136.1.2.1.

Thanks for helping me out, gang!!!
Butler Did It is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 07-06-2004, 11:31 AM   #2 (permalink)
Inactive
 
Join Date: 05-26-04
Posts: 13
iTrader: 0 / 0%
Latest Blog:
None

Butler Did It is liked by many
bump

Has anyone had experience with ASP forms and Microsoft Exchange Server?

Thanks!
Butler Did It is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2004, 06:22 PM   #3 (permalink)
Inactive
 
Ricoool's Avatar
 
Join Date: 10-13-03
Location: wonderfull Copenhagen, DK
Posts: 1,256
iTrader: 0 / 0%
Latest Blog:
None

Ricoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to beholdRicoool is a splendid one to behold
Send a message via Skype™ to Ricoool
Are you using brainjar.com ASP FormMail ??
if so, you need to know what type of mail-component is on the webserver, no need to go into what kind of mail server is used
[code:1:e0cb25ea46]Must be set to one of "ASPMail", "CDONTS", "CDOSYS" or "JMail". [/code:1:e0cb25ea46]
so if it is ASPMail then
[code:1:e0cb25ea46]referers = Array("www.komota.com","komota.com")
mailComp = "ASPMail"
smtpServer = "mail.komota.com"
fromAddr = "sales@komota.com"[/code:1:e0cb25ea46]
hope it helps
Ricoool is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2004, 07:13 PM   #4 (permalink)
v7n Mentor
 
imaginemn's Avatar
 
Join Date: 02-18-04
Location: Minneapolis, Minnesota
Posts: 1,941
iTrader: 0 / 0%
Latest Blog:
None

imaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to all
Send a message via MSN to imaginemn Send a message via Yahoo to imaginemn Send a message via Skype™ to imaginemn
If you really want to use Exchange Server to send email through a form.

Here is a sample script you can use.

[code:1:d168d4093f]<%@ Language=VBScript %>
<%
submit = Request.Form.Item("B1")

if submit = "Send" then
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields
' 3 means that you are asking mail to be sent using Exchange Server.

Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 3
Flds("http://schemas.microsoft.com/cdo/configuration/user") = "Administrator"
Flds("http://schemas.microsoft.com/cdo/configuration/password") = "Password123"
Flds.Update

Set iMsg.Configuration = iConf
iMsg.To = Request.Form.Item("Text1")
iMsg.From = "administrator@domain.microsoft.com"
iMsg.Subject = Request.Form.Item("Text3")
iMsg.TextBody = Request.Form.Item("TextArea1")
iMsg.Send

end if

%>

<html>
<head>

</head>

<body bgcolor=black >
<% if submit = "Send" then
%><font color=white><b><u> Mail Sent</u></b></font> <%

else%>
<form name="mnFrm" method="post" action="SendMail.asp">
<P>
<base target="_top">
<TABLE cellPadding=4 cellSpacing=0 class=Nav2>
<tr>
<TD><font color=red>To</font> </TD>
<TD><INPUT name=Text1 size=58 style="HEIGHT: 22px; WIDTH: 500px"></TD></TR>
<TR>

<TD><LABEL><font color=red>Subject </font> </LABEL></TD>
<TD><INPUT border=0 name=Text3 size=58
style="HEIGHT: 22px; WIDTH: 500px"></TD></TR>
<TR>
<TD vAlign=top><LABEL><font color=red>Body</font> </LABEL></TD>
<TD><TEXTAREA cols=63 name=TextArea1 rows=30 style="BACKGROUND-COLOR: white; HEIGHT: 165px; WIDTH: 590px"></TEXTAREA>

<P></P>
<P><BR></P></TD></TR></TABLE><INPUT name=B1 type=submit value="Send"></P>
</form><%end if %>
</body>
</html>[/code:1:d168d4093f]

Another recommendation is to use CDONTS instead. This is installed with IIS. Unless the object is disabled this is what you should be using.

[code:1:d168d4093f]<%
Option Explicit

Dim objNewMail

Set objNewMail = Server.CreateObject("CDONTS.NewMail")

objNewMail.From = "administrator@domain.com"
objNewMail.To = "user@user.com"

objNewMail.Subject = "This is a test Mail"
objNewMail.Body = "This is the Body text of this test mail."
objNewMail.Send

Set objNewMail = Nothing

Response.Write "Email has been sent"

%>[/code:1:d168d4093f]

It's possible that ASPMail is not installed on the server that you are trying to run your script on. You could also check to see if the other components that Ricoool mentioned are installed on the server.

imaginemn
__________________
Imagine Creative Services
Design : Marketing : Multimedia : More
imaginemn is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up microsoft exchange server scott Walker Dedicated Servers 1 04-23-2004 08:13 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 04:30 AM.
© Copyright 2008 V7 Inc