email
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngbeta' list.


Li, Fang
Hello,

I try to use the following code to send a email, but nothing happen. can
some one tell me what's wrong.

Thanks,
Fang

public void Button1_Click (object sender, System.EventArgs e)
{
    MailMessage mmMessage = new MailMessage();
    mmMessage.To = "Click here to reveal e-mail address";
    mmMessage.From = "Click here to reveal e-mail address";
    mmMessage.Subject = "This is a test e-mail";
    mmMessage.BodyFormat = MailFormat.Text;
    mmMessage.Body = "This is a test";
    SmtpMail.Send(mmMessage);

    msg.Text = "Done"; // I got this message
}

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 2:22 PM
To: aspngbeta
Subject: [aspngbeta] RE: Page_UnLoad

At the point of Page_Unload, the page has already been rendered to html for
sending to the browser. changing anything at this point will not effect what
the browser sees.

many people might use this event handler for closing/discarding objects that
they wanted to use during the whole lifecycle of the page.

another possible use of this event is to store any hit-tracking information.
If I'm not misunderstanding, at this point the page is already being sent
off to the browser, so doing any tracking in this event as opposed to
page_load would be a good thing because it wouldn't interrupt the user
experience.

Andy Smith
Staff Programmer
Harding ESE

    -----Original Message-----
        From:    Click here to reveal e-mail address
Sent:    Monday, April 30, 2001 8:07 AM
To:    "aspngbeta" <Click here to reveal e-mail address>
Subject:    [aspngbeta] RE: Page_UnLoad
    
I would think that running server side code would probably not be possible
in most cases. Mainly since the browser will not tell the server that it has
finished with that page. At best the server might be able to guess from the
fact the same computer just asked for a new page but it can't be sure if it
is going in a new window or not.

About all you could do is put stuff into clientside script that will run on
page close or whatever (I'm fairly sure there is such a thing since some
windows spawn new ones when you kill them. However, the way web pages work
would suggest that a serverside on close event would be impossible and, as
far as my thinking currently goes, unnecessary.

Cheers

Chris
--
Technical Researcher
Domino
www.domino.com

[Original message clipped]

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
    
Peter Weng
Make sure you're SMTP service is running on your web server. If you're
running Windows 2000 go to start then run then type "inetmgr". Make sure
your Default SMTP Virtual Server is installed and running.

-Peter
http://www.devhood.com

-----Original Message-----
From: Li, Fang [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:32 PM
To: aspngbeta
Subject: [aspngbeta] email

Hello,

I try to use the following code to send a email, but nothing happen. can
some one tell me what's wrong.

Thanks,
Fang

public void Button1_Click (object sender, System.EventArgs e)
{
    MailMessage mmMessage = new MailMessage();
    mmMessage.To = "Click here to reveal e-mail address";
    mmMessage.From = "Click here to reveal e-mail address";
    mmMessage.Subject = "This is a test e-mail";
    mmMessage.BodyFormat = MailFormat.Text;
    mmMessage.Body = "This is a test";
    SmtpMail.Send(mmMessage);

    msg.Text = "Done"; // I got this message
}

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 2:22 PM
To: aspngbeta
Subject: [aspngbeta] RE: Page_UnLoad

At the point of Page_Unload, the page has already been rendered to html
for
sending to the browser. changing anything at this point will not effect
what
the browser sees.

many people might use this event handler for closing/discarding objects
that
they wanted to use during the whole lifecycle of the page.

another possible use of this event is to store any hit-tracking
information.
If I'm not misunderstanding, at this point the page is already being
sent
off to the browser, so doing any tracking in this event as opposed to
page_load would be a good thing because it wouldn't interrupt the user
experience.

Andy Smith
Staff Programmer
Harding ESE

    -----Original Message-----
        From:    Click here to reveal e-mail address
Sent:    Monday, April 30, 2001 8:07 AM
To:    "aspngbeta" <Click here to reveal e-mail address>
Subject:    [aspngbeta] RE: Page_UnLoad
    
I would think that running server side code would probably not be
possible
in most cases. Mainly since the browser will not tell the server that it
has
finished with that page. At best the server might be able to guess from
the
fact the same computer just asked for a new page but it can't be sure if
it
is going in a new window or not.

About all you could do is put stuff into clientside script that will run
on
page close or whatever (I'm fairly sure there is such a thing since some
windows spawn new ones when you kill them. However, the way web pages
work
would suggest that a serverside on close event would be impossible and,
as
far as my thinking currently goes, unnecessary.

Cheers

Chris
--
Technical Researcher
Domino
www.domino.com

[Original message clipped]

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
    
Li, Fang
Thanks Peter:

the Default SMTP Virtual Server is running.
I use windows 2000. any more help?

Fang

-----Original Message-----
From: Peter Weng [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:45 PM
To: aspngbeta
Subject: [aspngbeta] RE: email

Make sure you're SMTP service is running on your web server. If you're
running Windows 2000 go to start then run then type "inetmgr". Make sure
your Default SMTP Virtual Server is installed and running.

-Peter
http://www.devhood.com

-----Original Message-----
From: Li, Fang [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:32 PM
To: aspngbeta
Subject: [aspngbeta] email

Hello,

I try to use the following code to send a email, but nothing happen. can
some one tell me what's wrong.

Thanks,
Fang

public void Button1_Click (object sender, System.EventArgs e)
{
    MailMessage mmMessage = new MailMessage();
    mmMessage.To = "Click here to reveal e-mail address";
    mmMessage.From = "Click here to reveal e-mail address";
    mmMessage.Subject = "This is a test e-mail";
    mmMessage.BodyFormat = MailFormat.Text;
    mmMessage.Body = "This is a test";
    SmtpMail.Send(mmMessage);

    msg.Text = "Done"; // I got this message
}

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 2:22 PM
To: aspngbeta
Subject: [aspngbeta] RE: Page_UnLoad

At the point of Page_Unload, the page has already been rendered to html
for
sending to the browser. changing anything at this point will not effect
what
the browser sees.

many people might use this event handler for closing/discarding objects
that
they wanted to use during the whole lifecycle of the page.

another possible use of this event is to store any hit-tracking
information.
If I'm not misunderstanding, at this point the page is already being
sent
off to the browser, so doing any tracking in this event as opposed to
page_load would be a good thing because it wouldn't interrupt the user
experience.

Andy Smith
Staff Programmer
Harding ESE

    -----Original Message-----
        From:    Click here to reveal e-mail address
Sent:    Monday, April 30, 2001 8:07 AM
To:    "aspngbeta" <Click here to reveal e-mail address>
Subject:    [aspngbeta] RE: Page_UnLoad
    
I would think that running server side code would probably not be
possible
in most cases. Mainly since the browser will not tell the server that it
has
finished with that page. At best the server might be able to guess from
the
fact the same computer just asked for a new page but it can't be sure if
it
is going in a new window or not.

About all you could do is put stuff into clientside script that will run
on
page close or whatever (I'm fairly sure there is such a thing since some
windows spawn new ones when you kill them. However, the way web pages
work
would suggest that a serverside on close event would be impossible and,
as
far as my thinking currently goes, unnecessary.

Cheers

Chris
--
Technical Researcher
Domino
www.domino.com

[Original message clipped]

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
    
Edward Kim
Also check on your Windows Server running IIS - c:\InetPub\mailroot\queue
if there are messages sitting in this directory,
then either the SMTP service needs to be restarted
or check with your network admin... there may be firewall or router
restrictions from relaying smtp traffic (e-mail). If there are messages in
the queue directory just delete them, else they will sit there forever.
Also first try to send the message to yourself (inside your own mail
gateway), if you can send mail to yourself but not the outside world, then
most probably network security is blocking it.
Check your basic network settings: valid IP address, DNS, Default gateway,
etc.

I find that the IIS SMTP service is 'quarky', sometimes it works sometimes
it doesn't.
You may also want to try re-writting the page from scratch it may be
corrupt.

CDONTS RULE!
What would happen if someone sent spam to this newsgroup using CDONTS???

Also here is some sample code provided by Carsten Ivarsen in another
message:
Hi everyone.

I am converting some old ASP scripts into ASP.NET, and have now encountered
a problem. In the old scripts I used the "NewMail" object in CDONTS library
to send an EDI-mail to another system in plain text format, but when I use
the SMTPMail object in ASP.NET it wraps the length of the mail-lines to
approx. 80 chars. Are there anyone outthere who knows how to get rid of this
line warpping in the mail?

The old ASP code I used for test:

Set SendMail = CreateObject("CDONTS.NewMail")
SendMail.From = ("Click here to reveal e-mail address")
SendMail.To = ("Click here to reveal e-mail address")
SendMail.Subject = "Test"
SendMail.BodyFormat = 1
SendMail.MailFormat = 0
SendMail.Body = "This is a test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf
SendMail.Send
Set SendMail = Nothing

The new ASP.NET code I used for test, which wraps the lines:

Dim Message As New MailMessage()
Message.Body = "This is a test" & controlchars.CrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf
Message.Subject = "Test"
Message.To = "Click here to reveal e-mail address"
Message.From = "Click here to reveal e-mail address"
Message.BodyFormat = Web.Util.MailFormat.Text
SmtpMail.Send(Message)

-----Original Message-----
From: Peter Weng [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:45 PM
To: aspngbeta
Subject: [aspngbeta] RE: email

Make sure you're SMTP service is running on your web server. If you're
running Windows 2000 go to start then run then type "inetmgr". Make sure
your Default SMTP Virtual Server is installed and running.

-Peter
http://www.devhood.com

-----Original Message-----
From: Li, Fang [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:32 PM
To: aspngbeta
Subject: [aspngbeta] email

Hello,

I try to use the following code to send a email, but nothing happen. can
some one tell me what's wrong.

Thanks,
Fang

public void Button1_Click (object sender, System.EventArgs e)
{
    MailMessage mmMessage = new MailMessage();
    mmMessage.To = "Click here to reveal e-mail address";
    mmMessage.From = "Click here to reveal e-mail address";
    mmMessage.Subject = "This is a test e-mail";
    mmMessage.BodyFormat = MailFormat.Text;
    mmMessage.Body = "This is a test";
    SmtpMail.Send(mmMessage);

    msg.Text = "Done"; // I got this message
}

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 2:22 PM
To: aspngbeta
Subject: [aspngbeta] RE: Page_UnLoad

At the point of Page_Unload, the page has already been rendered to html
for
sending to the browser. changing anything at this point will not effect
what
the browser sees.

many people might use this event handler for closing/discarding objects
that
they wanted to use during the whole lifecycle of the page.

another possible use of this event is to store any hit-tracking
information.
If I'm not misunderstanding, at this point the page is already being
sent
off to the browser, so doing any tracking in this event as opposed to
page_load would be a good thing because it wouldn't interrupt the user
experience.

Andy Smith
Staff Programmer
Harding ESE

    -----Original Message-----
        From:    Click here to reveal e-mail address
Sent:    Monday, April 30, 2001 8:07 AM
To:    "aspngbeta" <Click here to reveal e-mail address>
Subject:    [aspngbeta] RE: Page_UnLoad

I would think that running server side code would probably not be
possible
in most cases. Mainly since the browser will not tell the server that it
has
finished with that page. At best the server might be able to guess from
the
fact the same computer just asked for a new page but it can't be sure if
it
is going in a new window or not.

About all you could do is put stuff into clientside script that will run
on
page close or whatever (I'm fairly sure there is such a thing since some
windows spawn new ones when you kill them. However, the way web pages
work
would suggest that a serverside on close event would be impossible and,
as
far as my thinking currently goes, unnecessary.

Cheers

Chris
--
Technical Researcher
Domino
www.domino.com

[Original message clipped]

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
    
Murat Cureklibatir
have you got an SMTP server on your machine. If not, you cant send mails
like this....

[Original message clipped]

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Reply to this message...
 
    
Li, Fang
Thanks Edward,

You are right, everything is in the queue directory, the email and the delay
message. I delete them and restart SMTP, still not work, I will talk to my
administrator, maybe is the network settings problem.

Fang

-----Original Message-----
From: Edward Kim [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 6:23 PM
To: aspngbeta
Subject: [aspngbeta] RE: email

Also check on your Windows Server running IIS - c:\InetPub\mailroot\queue
if there are messages sitting in this directory,
then either the SMTP service needs to be restarted
or check with your network admin... there may be firewall or router
restrictions from relaying smtp traffic (e-mail). If there are messages in
the queue directory just delete them, else they will sit there forever.
Also first try to send the message to yourself (inside your own mail
gateway), if you can send mail to yourself but not the outside world, then
most probably network security is blocking it.
Check your basic network settings: valid IP address, DNS, Default gateway,
etc.

I find that the IIS SMTP service is 'quarky', sometimes it works sometimes
it doesn't.
You may also want to try re-writting the page from scratch it may be
corrupt.

CDONTS RULE!
What would happen if someone sent spam to this newsgroup using CDONTS???

Also here is some sample code provided by Carsten Ivarsen in another
message:
Hi everyone.

I am converting some old ASP scripts into ASP.NET, and have now encountered
a problem. In the old scripts I used the "NewMail" object in CDONTS library
to send an EDI-mail to another system in plain text format, but when I use
the SMTPMail object in ASP.NET it wraps the length of the mail-lines to
approx. 80 chars. Are there anyone outthere who knows how to get rid of this
line warpping in the mail?

The old ASP code I used for test:

Set SendMail = CreateObject("CDONTS.NewMail")
SendMail.From = ("Click here to reveal e-mail address")
SendMail.To = ("Click here to reveal e-mail address")
SendMail.Subject = "Test"
SendMail.BodyFormat = 1
SendMail.MailFormat = 0
SendMail.Body = "This is a test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf
SendMail.Send
Set SendMail = Nothing

The new ASP.NET code I used for test, which wraps the lines:

Dim Message As New MailMessage()
Message.Body = "This is a test" & controlchars.CrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf
Message.Subject = "Test"
Message.To = "Click here to reveal e-mail address"
Message.From = "Click here to reveal e-mail address"
Message.BodyFormat = Web.Util.MailFormat.Text
SmtpMail.Send(Message)

-----Original Message-----
From: Peter Weng [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:45 PM
To: aspngbeta
Subject: [aspngbeta] RE: email

Make sure you're SMTP service is running on your web server. If you're
running Windows 2000 go to start then run then type "inetmgr". Make sure
your Default SMTP Virtual Server is installed and running.

-Peter
http://www.devhood.com

-----Original Message-----
From: Li, Fang [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:32 PM
To: aspngbeta
Subject: [aspngbeta] email

Hello,

I try to use the following code to send a email, but nothing happen. can
some one tell me what's wrong.

Thanks,
Fang

public void Button1_Click (object sender, System.EventArgs e)
{
    MailMessage mmMessage = new MailMessage();
    mmMessage.To = "Click here to reveal e-mail address";
    mmMessage.From = "Click here to reveal e-mail address";
    mmMessage.Subject = "This is a test e-mail";
    mmMessage.BodyFormat = MailFormat.Text;
    mmMessage.Body = "This is a test";
    SmtpMail.Send(mmMessage);

    msg.Text = "Done"; // I got this message
}

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 2:22 PM
To: aspngbeta
Subject: [aspngbeta] RE: Page_UnLoad

At the point of Page_Unload, the page has already been rendered to html
for
sending to the browser. changing anything at this point will not effect
what
the browser sees.

many people might use this event handler for closing/discarding objects
that
they wanted to use during the whole lifecycle of the page.

another possible use of this event is to store any hit-tracking
information.
If I'm not misunderstanding, at this point the page is already being
sent
off to the browser, so doing any tracking in this event as opposed to
page_load would be a good thing because it wouldn't interrupt the user
experience.

Andy Smith
Staff Programmer
Harding ESE

    -----Original Message-----
        From:    Click here to reveal e-mail address
Sent:    Monday, April 30, 2001 8:07 AM
To:    "aspngbeta" <Click here to reveal e-mail address>
Subject:    [aspngbeta] RE: Page_UnLoad

I would think that running server side code would probably not be
possible
in most cases. Mainly since the browser will not tell the server that it
has
finished with that page. At best the server might be able to guess from
the
fact the same computer just asked for a new page but it can't be sure if
it
is going in a new window or not.

About all you could do is put stuff into clientside script that will run
on
page close or whatever (I'm fairly sure there is such a thing since some
windows spawn new ones when you kill them. However, the way web pages
work
would suggest that a serverside on close event would be impossible and,
as
far as my thinking currently goes, unnecessary.

Cheers

Chris
--
Technical Researcher
Domino
www.domino.com

[Original message clipped]

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
    
Edward Kim
Try this, just copy the code into a text document and call it spam.asp
then place the file into your default http directory and open it with your
web browser,
put a valid email address in the objCDO.To field and if u use multiples then
separate with a comma,
I better not get any spam (lol), I can trace every message:

<%

    if Request.Querystring("isSubmitted") = "yes" then

        Dim comments

        Dim objCDO

        fname = Request.Querystring("First_Name")

        lname = Request.Querystring("Last_Name")

        comments = Request.Querystring("comments")

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

        objCDO.From = "yo ASP Boy"

        objCDO.To = "Click here to reveal e-mail address"

        objCDO.Cc = ""

        objCDO.Bcc = ""

        objCDO.Subject = "I did this using Microsoft's ASP CDONTS U LINUX
BEEEATCH!"

        objCDO.Body = comments

        objCDO.BodyFormat = 1

        objCDO.MailFormat = 1

        objCDO.Send

        ConfirmMsg = "Thanks for submitting your questions and comments!"

    end if

%>

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>yo</title>
</head>

<body bgcolor=#FFFFFF leftmargin=0 topmargin=0>

<% if ConfirmMsg <> "" then %>

            <h2><%= ConfirmMsg %></h2>

        <% end if %>

        <table>
        <tr><td width="5"> </td><td>
    <form action="spam.asp" method="get" name="Input_Form">

            <br>

            Contact us by e-mail with your general questions and we'll get back to
you: <br>
    <textarea name="comments" rows=7 cols=75>
YOU LIKE SPAM???

WELL DEAL WITH CDONTS!

    </textarea>

            <br>

            <input type="hidden" name="isSubmitted" value="yes">

            <input type="submit" value="Submit Form">

        </form></td>
</table>

<hr>

</body>
</html>

It should work sending at least to your own e-mail address, otherwise the
smtp service is not working properly.

-----Original Message-----
From: Li, Fang [mailto:Click here to reveal e-mail address]
Sent: Tuesday, May 01, 2001 10:03 AM
To: aspngbeta
Subject: [aspngbeta] RE: email

Thanks Edward,

You are right, everything is in the queue directory, the email and the delay
message. I delete them and restart SMTP, still not work, I will talk to my
administrator, maybe is the network settings problem.

Fang

-----Original Message-----
From: Edward Kim [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 6:23 PM
To: aspngbeta
Subject: [aspngbeta] RE: email

Also check on your Windows Server running IIS - c:\InetPub\mailroot\queue
if there are messages sitting in this directory,
then either the SMTP service needs to be restarted
or check with your network admin... there may be firewall or router
restrictions from relaying smtp traffic (e-mail). If there are messages in
the queue directory just delete them, else they will sit there forever.
Also first try to send the message to yourself (inside your own mail
gateway), if you can send mail to yourself but not the outside world, then
most probably network security is blocking it.
Check your basic network settings: valid IP address, DNS, Default gateway,
etc.

I find that the IIS SMTP service is 'quarky', sometimes it works sometimes
it doesn't.
You may also want to try re-writting the page from scratch it may be
corrupt.

CDONTS RULE!
What would happen if someone sent spam to this newsgroup using CDONTS???

Also here is some sample code provided by Carsten Ivarsen in another
message:
Hi everyone.

I am converting some old ASP scripts into ASP.NET, and have now encountered
a problem. In the old scripts I used the "NewMail" object in CDONTS library
to send an EDI-mail to another system in plain text format, but when I use
the SMTPMail object in ASP.NET it wraps the length of the mail-lines to
approx. 80 chars. Are there anyone outthere who knows how to get rid of this
line warpping in the mail?

The old ASP code I used for test:

Set SendMail = CreateObject("CDONTS.NewMail")
SendMail.From = ("Click here to reveal e-mail address")
SendMail.To = ("Click here to reveal e-mail address")
SendMail.Subject = "Test"
SendMail.BodyFormat = 1
SendMail.MailFormat = 0
SendMail.Body = "This is a test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & vbCrLf
SendMail.Send
Set SendMail = Nothing

The new ASP.NET code I used for test, which wraps the lines:

Dim Message As New MailMessage()
Message.Body = "This is a test" & controlchars.CrLf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf & _
"This is a little test, This is a little test, This is
a little test, This is a little test, This is a little test, This is a
little test" & controlchars.crlf
Message.Subject = "Test"
Message.To = "Click here to reveal e-mail address"
Message.From = "Click here to reveal e-mail address"
Message.BodyFormat = Web.Util.MailFormat.Text
SmtpMail.Send(Message)

-----Original Message-----
From: Peter Weng [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:45 PM
To: aspngbeta
Subject: [aspngbeta] RE: email

Make sure you're SMTP service is running on your web server. If you're
running Windows 2000 go to start then run then type "inetmgr". Make sure
your Default SMTP Virtual Server is installed and running.

-Peter
http://www.devhood.com

-----Original Message-----
From: Li, Fang [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:32 PM
To: aspngbeta
Subject: [aspngbeta] email

Hello,

I try to use the following code to send a email, but nothing happen. can
some one tell me what's wrong.

Thanks,
Fang

public void Button1_Click (object sender, System.EventArgs e)
{
    MailMessage mmMessage = new MailMessage();
    mmMessage.To = "Click here to reveal e-mail address";
    mmMessage.From = "Click here to reveal e-mail address";
    mmMessage.Subject = "This is a test e-mail";
    mmMessage.BodyFormat = MailFormat.Text;
    mmMessage.Body = "This is a test";
    SmtpMail.Send(mmMessage);

    msg.Text = "Done"; // I got this message
}

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 2:22 PM
To: aspngbeta
Subject: [aspngbeta] RE: Page_UnLoad

At the point of Page_Unload, the page has already been rendered to html
for
sending to the browser. changing anything at this point will not effect
what
the browser sees.

many people might use this event handler for closing/discarding objects
that
they wanted to use during the whole lifecycle of the page.

another possible use of this event is to store any hit-tracking
information.
If I'm not misunderstanding, at this point the page is already being
sent
off to the browser, so doing any tracking in this event as opposed to
page_load would be a good thing because it wouldn't interrupt the user
experience.

Andy Smith
Staff Programmer
Harding ESE

    -----Original Message-----
        From:    Click here to reveal e-mail address
Sent:    Monday, April 30, 2001 8:07 AM
To:    "aspngbeta" <Click here to reveal e-mail address>
Subject:    [aspngbeta] RE: Page_UnLoad

I would think that running server side code would probably not be
possible
in most cases. Mainly since the browser will not tell the server that it
has
finished with that page. At best the server might be able to guess from
the
fact the same computer just asked for a new page but it can't be sure if
it
is going in a new window or not.

About all you could do is put stuff into clientside script that will run
on
page close or whatever (I'm fairly sure there is such a thing since some
windows spawn new ones when you kill them. However, the way web pages
work
would suggest that a serverside on close event would be impossible and,
as
far as my thinking currently goes, unnecessary.

Cheers

Chris
--
Technical Researcher
Domino
www.domino.com

[Original message clipped]

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
    
Chris Mayer (Solutions IQ)
Assuming the same context throughout [this] thread, does anyone if you
can (and how) set an alternative SMTP server?

-----Original Message-----
From: Li, Fang [mailto:Click here to reveal e-mail address]=20
Sent: Tuesday, May 01, 2001 7:03 AM
To: aspngbeta
Subject: [aspngbeta] RE: email

Thanks Edward,

You are right, everything is in the queue directory, the email and the
delay message. I delete them and restart SMTP, still not work, I will
talk to my administrator, maybe is the network settings problem.

Fang

-----Original Message-----
From: Edward Kim [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 6:23 PM
To: aspngbeta
Subject: [aspngbeta] RE: email

Also check on your Windows Server running IIS -
c:\InetPub\mailroot\queue if there are messages sitting in this
directory, then either the SMTP service needs to be restarted or check
with your network admin... there may be firewall or router restrictions
from relaying smtp traffic (e-mail). If there are messages in the queue
directory just delete them, else they will sit there forever. Also first
try to send the message to yourself (inside your own mail gateway), if
you can send mail to yourself but not the outside world, then most
probably network security is blocking it. Check your basic network
settings: valid IP address, DNS, Default gateway, etc.

I find that the IIS SMTP service is 'quarky', sometimes it works
sometimes it doesn't. You may also want to try re-writting the page from
scratch it may be corrupt.

CDONTS RULE!
What would happen if someone sent spam to this newsgroup using CDONTS???

Also here is some sample code provided by Carsten Ivarsen in another
message:
Hi everyone.

I am converting some old ASP scripts into ASP.NET, and have now
encountered a problem. In the old scripts I used the "NewMail" object in
CDONTS library to send an EDI-mail to another system in plain text
format, but when I use the SMTPMail object in ASP.NET it wraps the
length of the mail-lines to approx. 80 chars. Are there anyone outthere
who knows how to get rid of this line warpping in the mail?

The old ASP code I used for test:

Set SendMail =3D CreateObject("CDONTS.NewMail")
SendMail.From =3D ("Click here to reveal e-mail address")
SendMail.To =3D ("Click here to reveal e-mail address")
SendMail.Subject =3D "Test"
SendMail.BodyFormat =3D 1
SendMail.MailFormat =3D 0
SendMail.Body =3D "This is a test" & vbCrLf & _
"This is a little test, This is a little test,
This is a little test, This is a little test, This is a little test,
This is a little test" & vbCrLf & _
"This is a little test, This is a little test,
This is a little test, This is a little test, This is a little test,
This is a little test" & vbCrLf & _
"This is a little test, This is a little test,
This is a little test, This is a little test, This is a little test,
This is a little test" & vbCrLf
SendMail.Send
Set SendMail =3D Nothing

The new ASP.NET code I used for test, which wraps the lines:

Dim Message As New MailMessage()
Message.Body =3D "This is a test" & controlchars.CrLf & _
"This is a little test, This is a little test, This
is a little test, This is a little test, This is a little test, This is
a little test" & controlchars.crlf & _
"This is a little test, This is a little test, This
is a little test, This is a little test, This is a little test, This is
a little test" & controlchars.crlf & _
"This is a little test, This is a little test, This
is a little test, This is a little test, This is a little test, This is
a little test" & controlchars.crlf
Message.Subject =3D "Test"
Message.To =3D "Click here to reveal e-mail address"
Message.From =3D "Click here to reveal e-mail address"
Message.BodyFormat =3D Web.Util.MailFormat.Text
SmtpMail.Send(Message)

-----Original Message-----
From: Peter Weng [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:45 PM
To: aspngbeta
Subject: [aspngbeta] RE: email

Make sure you're SMTP service is running on your web server. If you're
running Windows 2000 go to start then run then type "inetmgr". Make sure
your Default SMTP Virtual Server is installed and running.

-Peter
http://www.devhood.com

-----Original Message-----
From: Li, Fang [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 5:32 PM
To: aspngbeta
Subject: [aspngbeta] email

Hello,

I try to use the following code to send a email, but nothing happen. can
some one tell me what's wrong.

Thanks,
Fang

public void Button1_Click (object sender, System.EventArgs e)
{
    MailMessage mmMessage =3D new MailMessage();
    mmMessage.To =3D "Click here to reveal e-mail address";
    mmMessage.From =3D "Click here to reveal e-mail address";
    mmMessage.Subject =3D "This is a test e-mail";
    mmMessage.BodyFormat =3D MailFormat.Text;
    mmMessage.Body =3D "This is a test";
    SmtpMail.Send(mmMessage);

    msg.Text =3D "Done"; // I got this message
}

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Monday, April 30, 2001 2:22 PM
To: aspngbeta
Subject: [aspngbeta] RE: Page_UnLoad

At the point of Page_Unload, the page has already been rendered to html
for sending to the browser. changing anything at this point will not
effect what the browser sees.

many people might use this event handler for closing/discarding objects
that they wanted to use during the whole lifecycle of the page.

another possible use of this event is to store any hit-tracking
information. If I'm not misunderstanding, at this point the page is
already being sent off to the browser, so doing any tracking in this
event as opposed to page_load would be a good thing because it wouldn't
interrupt the user experience.

Andy Smith
Staff Programmer
Harding ESE

    -----Original Message-----
        From:    Click here to reveal e-mail address
Sent:    Monday, April 30, 2001 8:07 AM
To:    "aspngbeta" <Click here to reveal e-mail address>
Subject:    [aspngbeta] RE: Page_UnLoad

I would think that running server side code would probably not be
possible in most cases. Mainly since the browser will not tell the
server that it has finished with that page. At best the server might be
able to guess from the fact the same computer just asked for a new page
but it can't be sure if it is going in a new window or not.

About all you could do is put stuff into clientside script that will run
on page close or whatever (I'm fairly sure there is such a thing since
some windows spawn new ones when you kill them. However, the way web
pages work would suggest that a serverside on close event would be
impossible and, as far as my thinking currently goes, unnecessary.

Cheers

Chris
--
Technical Researcher
Domino
www.domino.com

[Original message clipped]

| [aspngbeta] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT

| [aspngbeta] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT

Reply to this message...
 
 
System.EventArgs
System.Messaging.Message
System.Web.Mail.MailFormat
System.Web.Mail.MailMessage
System.Web.Mail.SmtpMail




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com