Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > NEWBIE: How to create a log file

Reply
Thread Tools

NEWBIE: How to create a log file

 
 
Tomas Vera
Guest
Posts: n/a
 
      09-12-2003
Hello All,
I'm new to ASP and am having problems with CDONTS.NewMail not always
delivering my mail. Unfortunately, it always seems to fail on a
particular recipient, so he's getting steamed!

In my code, I create two e-mails, one to an end-user, and one to a
sales rep. The e-mail to the user always succeeds, but the email to
the sales reps fails about 15-25% of the time. I'm trying to debug the
ASP page, and I figure using a log file may be the best way.

I want to test the sales rep's newMail object and write to a log file
when it fails (IsNull()), but I don't know how to create a log file in
ASP. Example:

Dim newMail
newMail = Server.CreateObject ("CDONTS.NewMail")
if(IsNull(newMail) then
' Code to write to a log file goes here
' Record the e-mail info for re-send later
' What goes here
else
' Code to create the mail components goes here
newMail.Send
newMail = nothing
end if

I know this is super-simple and just need a quick code snippet.

Thanks
-tomas
 
Reply With Quote
 
 
 
 
Tom B
Guest
Posts: n/a
 
      09-12-2003
Set newMail =
rather than
newMail=
"Tomas Vera" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello All,
> I'm new to ASP and am having problems with CDONTS.NewMail not always
> delivering my mail. Unfortunately, it always seems to fail on a
> particular recipient, so he's getting steamed!
>
> In my code, I create two e-mails, one to an end-user, and one to a
> sales rep. The e-mail to the user always succeeds, but the email to
> the sales reps fails about 15-25% of the time. I'm trying to debug the
> ASP page, and I figure using a log file may be the best way.
>
> I want to test the sales rep's newMail object and write to a log file
> when it fails (IsNull()), but I don't know how to create a log file in
> ASP. Example:
>
> Dim newMail
> newMail = Server.CreateObject ("CDONTS.NewMail")
> if(IsNull(newMail) then
> ' Code to write to a log file goes here
> ' Record the e-mail info for re-send later
> ' What goes here
> else
> ' Code to create the mail components goes here
> newMail.Send
> newMail = nothing
> end if
>
> I know this is super-simple and just need a quick code snippet.
>
> Thanks
> -tomas



 
Reply With Quote
 
 
 
 
Tomas Vera
Guest
Posts: n/a
 
      09-12-2003
On Fri, 12 Sep 2003 12:27:03 -0400, "Tom B" <(E-Mail Removed)>
wrote:

>Set newMail =
>rather than
>newMail=


Sorry, bad typing. I am using the "Set=" notation.
Now, about that log file......
 
Reply With Quote
 
TomB
Guest
Posts: n/a
 
      09-12-2003
You could do this......
http://www.15seconds.com/issue/990930.htm

but that seems like a lot of work. I assume you just want to have a record
of failed messages in a text file.

Make sure you have write permissions on a directory then
http://www.w3schools.com/asp/asp_ref_textstream.asp
http://www.w3schools.com/asp/met_writeline.asp
That ought to get you started.


"Tomas Vera" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Fri, 12 Sep 2003 12:27:03 -0400, "Tom B" <(E-Mail Removed)>
> wrote:
>
> >Set newMail =
> >rather than
> >newMail=

>
> Sorry, bad typing. I am using the "Set=" notation.
> Now, about that log file......



 
Reply With Quote
 
Tomas Vera
Guest
Posts: n/a
 
      09-12-2003
Thanks!
That's exactly what I was looking for.

-tomas (posting via some web site!)



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
dlbjr
Guest
Posts: n/a
 
      09-13-2003
Tom,

Just curious -
what email clients are they using?

CDONTS email settings by default will not push to a Lotus Notes Client, but
will work with many others like outlook.

Here are settings to send email to a Lotus Domino Server.

Set MailObj = CreateObject("CDONTS.NewMail")
MailObj.MailFormat = 0
MailObj.BodyFormat = 0
MailObj.From = "me"
MailObj.To = "you"
MailObj.Subject = strSubject
MailObj.Body = strMemo
MailObj.Send

-dlbjr

invariable unerring alien


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Create a log-in & log-out page Leena Jethwa Ruby 2 05-01-2009 02:19 PM
How to log independently of other webapps using log4j? Also, reading from log file from within servlet? unomystEz Java 0 11-19-2006 10:42 AM
Urgent Pls: Facing problem in reading Log information from Log file, created by IIS Amratash ASP .Net 0 04-13-2004 09:08 AM
Need help on the Permissions needed to log to Event Log from ASP.NET? Henrik_the_boss ASP .Net 0 11-05-2003 10:14 AM



Advertisments