I hope someone can help me. I'm trying to setup an ASP page that will automatically send and email once the submit button is clicked. But my problem is that Lotus Notes is the email client and the script below is setup for Outlook to be the client. I've tried looking on the web but I can't seem to find anything that helps. Can anyone help me alter the code below so that it will work with Lotus Notes?
<%
if not IsEmpty(Request .Form("Send")) then
if Request.Form("S endTo") = "All" then
set RSEmails = conn.Execute("s elect EmpEmailAddress from I1BlastEmps")
elseif Request.Form("S endTo") = "Department " then
set RSEmails = conn.Execute("s elect EmpEmailAddress from I1BlastEmps " _
& "where Department = '" & Request.Form("D epartmentName") & "'")
else
set RSEmails = conn.Execute("s elect EmpEmailAddress from I1BlastEmps " _
& "where Role = '" & Request.Form("R oleName") & "'")
end if
set RSWhoForm = conn.Execute("S elect EmpID, EmpEmailAddress from I1BlastEmps " _
& "where EmpID = " & Request.Form("E mpID"))
FromAddress = RSWhoForm("EmpE mailAddress")
do Until RSEmails.eof
set objMail = CreateObject("C DONTS.NewMail")
objMail.Send FromAddress,RSE mails("EmpEmail Address"), _
cstr(Request.Fo rm("Subject")), cstr(Request.Fo rm("Message"))
set objmail = nothing
RSEmails.MoveNe xt
loop
conn.Execute "Insert Into I1Blasts (EmpID, Subject, Message, WhenSent) values (" _
& "" & Request.Form("E mpID") & ", " _
& "'" & Request.Form("S ubject") & "', " _
& "'" & Request.Form("M essage") & "', " _
& "'" & Now() & "')"
TheMessage = "Message was sent!"
else
TheMessage = "Enter your message below"
end if
set RSDepartments = conn.Execute("s elect distinct Department from " _
& "I1BlastEmp s order by Department")
set RSRoles = conn.Execute("s elect distinct Role from " _
& "I1BlastEmp s order by Role")
set RSEmps = conn.Execute("s elect EmpID, EmpName from " _
& "I1BlastEmp s order by EmpName")
%>
4 2188
do Until RSEmails.eof
set objMail = CreateObject("C DONTS.NewMail")
objMail.Send FromAddress,RSE mails("EmpEmail Address"), _
cstr(Request.Fo rm("Subject")), cstr(Request.Fo rm("Message"))
set objmail = nothing
RSEmails.MoveNe xt
loop
I think you should write Server.CreateOb ject instead CreateObject. You should write this statement outside of the loop, otherwise it will create object every for sending the mail.
The script will send mail using the SMTP server. In that case email client is not that important matter. Almost same sort of script worked for me. I found no problem with it.
susen
Thanks for the response susen. I'm able to create the objMail object just fine. But I'm getting the error "(0x8007000 3) /EmailBlast.asp, line 25". Line 25 is where I try to send the email. Using objMail.Send. How can I fix this?
set objMail = Server.CreateOb ject("CDONTS.Ne wMail")
do Until RSEmails.eof objMail.Send FromAddress,RSE mails("EmpEmail Address"), _
cstr(Request.Fo rm("Subject")), cstr(Request.Fo rm("Message"))
set objmail = nothing
RSEmails.MoveNe xt
loop
Hi, objMail.Send FromAddress,RSE mails("EmpEmail Address"), _
cstr(Request.Fo rm("Subject")), cstr(Request.Fo rm("Message"))
Please try writing this way - - objMail.From = FromAddress
-
objMail.To = RSEmails("EmpEmailAddress")
-
objMail.Subject = cstr(Request.Form("Subject"))
-
objMail.Body = cstr(Request.Form("Message"))
-
objMail.Send
You need to set the required attributes first and then call the Send function. I hope this will work for you.
Susen
My dear friend CDONTS wont work anymore.. use new CDOSYS
here is the code
<%
dim too,from,messag e,subject
from=request.Fo rm("txtTo")
too=request.For m("txtFrom")
subject=request .Form("textSubj ect")
message=request .Form("message" )
'------------------------------Configuration-------------------
sch = "http://schemas.microso ft.com/cdo/configuration/"
Set cdoConfig = Server.CreateOb ject("CDO.Confi guration")
cdoConfig.Field s.Item(sch & "sendusing" ) = 2
cdoConfig.Field s.Item(sch & "smtpserver ") = "192.168.29 .20"
cdoConfig.field s.update
'-------------------------------------------------------------
Set myMail=CreateOb ject("CDO.Messa ge")
myMail.Configur ation = cdoConfig
myMail.Subject= subject
myMail.From=fro m
myMail.To=too
myMail.TextBody =message
myMail.Send
set myMail=nothing
response.write( "your mail has been send")
%>
Happy coding
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: joe215 |
last post by:
I want my users to send emails from a Windows app that I am developing in
Visual Basic.NET 2003. I found a good example of sending email to a SMTP
server using the SmtpMail class. However, using this, it seems, that the
user must install IIS on their computer. Isn't there a class that will
detect whatever mail server is available on a computer and use that? How do
I create this functionality without having the user add any other...
|
by: kimberly.shaffer |
last post by:
Okay, I can automate sending of multiple emails with records using
Groupwise and Access DB. But now what I need to do is send multiple
fields associated with one field out automatically and can't figure out
how to do it.
For instance, my records look like this:
strEmail strGroup
jjohns@comcast.net catlovers
jjohns@comcast.net doglovers
|
by: Bonj |
last post by:
Right guys.
(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)
I'm sure I've seen posts here before criticising the practice of automating
outlook for the purpose of programatically sending email, on the grounds that
it's naff. Well now we're really landed in...
|
by: B-Dog |
last post by:
I've built a small app that sends mail through our ISP's SMTP server but
when I try to send through my local exchange server I get CDO error. Does
webmail use SMTP or does it strictly rely on CDOmail. I don't want to use
the Outlook reference because outlook prompts each time program access it
and I have found a way to disable that. Can I use webmail with exchange?
Thanks
|
by: Ant |
last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send
mail, however it's not sending any emails.
I'm using it on a Windows 2003 server.
The simplest way to use this is
smtpMail.Send("from@here.com", to@there.com, "Message subject", "Message
Body")
I'm sending it to my own email address on a different server using a dummy
| |
by: Anuradha |
last post by:
Dear All
How can i send mails using vb.net
Thanx all
|
by: Eric Sheu |
last post by:
Greetings,
I have been searching the web like mad for a solution to my SMTP problem. I
am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a
web site I have created to the members of my organization. I think my problem
is incorrectly setting the settings on my server or an authentication
problem. Here is the code I have written to send a test message:
-----Code Begins: Sensitive Information Replaced by -----...
|
by: Roger Withnell |
last post by:
I'm sending Russian text in an email generated from the website which
displays in the email as ??????????
The website is set to codepage 65001 and the charset to utf-8.
Please advise.
Posted Via Usenet.com Premium Usenet Newsgroup Services
|
by: undbund |
last post by:
Hi I am creating a newsletter system. The software should run from
desktop computer (localhost) but be able to send email to anyone on
the internet. Can you guys give me some ideas on how to achieve this.
Thanks
|
by: Markgoldin |
last post by:
I am sending an XML data from not dontnet process to a .Net via socket
listener.
Here is a data sample:
<VFPData>
<serverdata>
<coderun>updateFloor</coderun>
<area>MD2</area>
<zone>BOXING</zone>
<status>Running</status>
<job>1000139233</job>
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |