.NETGURU
SMTP.SendMail Problem
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-mail' list.


Austin Castro
-- Moved from [aspfreeforall] to [ngfx-mail] by Marcie Jones <Click here to reveal e-mail address> --

I cannot get my sendmail asp.net page to work.

The following is the code:

<%@ Import namespace="System.Web.Mail" %>

<Script runat="server">

SmptMail.Send("Click here to reveal e-mail address","Click here to reveal e-mail address","My Subject","This is my
body")

</Script>

Trying to run the page gives error saying that SmptMail is not declared. I
can create a simple file with the necessary info and save it in the
c:\inetpub\mailroot\pickup directory and it is sent successfully so I think
my SMTP is up and running. Any ideas anyone?

Austin

Reply to this message...
 
    
BettyB
Did you retype your code or copy and paste? I believe it should be
SmtpMail.Send instead of SmptMail.Send.

At 07:03 PM 6/23/2002 -0800, you wrote:
[Original message clipped]

Reply to this message...
 
    
Carlos Magalhaes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE>RE: [ngfx-mail] SMTP.SendMail Problem</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Ok from what I can see there is a few things here try =
this:</FONT>
</P>

<P><FONT SIZE=3D2><script language=3DVB></FONT>
</P>

<P><FONT SIZE=3D2>Dim Mail as New MailMessage()</FONT>
<BR><FONT SIZE=3D2>SmtpMail.SmtpServer =3D "localhost" ' Or =
the smtp server on your network THIS IS IMPORTANT</FONT>
<BR><FONT SIZE=3D2>Mail.to =3D "Click here to reveal e-mail address"</FONT>
<BR><FONT SIZE=3D2>Mail.From =3D "Click here to reveal e-mail address"</FONT>
<BR><FONT SIZE=3D2>Mail.Subject =3D "My subject"</FONT>
<BR><FONT SIZE=3D2>Mail.body =3D"This is my body"</FONT>
</P>

<P><FONT SIZE=3D2>SmtpMail.Send(mail) ' Not the mail in brackets is the =
mail object dimed above!!!!</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>HTH \</FONT>
</P>

<P><FONT SIZE=3D2>Let us know</FONT>
</P>

<P><FONT SIZE=3D2> </FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Austin Castro [<A =
HREF=3D"mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Monday, June 24, 2002 5:04 AM</FONT>
<BR><FONT SIZE=3D2>To: ngfx-mail</FONT>
<BR><FONT SIZE=3D2>Subject: [ngfx-mail] SMTP.SendMail Problem</FONT>
</P>

<P><FONT SIZE=3D2>-- Moved from [aspfreeforall] to [ngfx-mail] by =
Marcie Jones <Click here to reveal e-mail address> --</FONT>
</P>

<P><FONT SIZE=3D2>I cannot get my sendmail asp.net page to work.</FONT>
</P>

<P><FONT SIZE=3D2>The following is the code:</FONT>
</P>

<P><FONT SIZE=3D2><%@ Import namespace=3D"System.Web.Mail" =
%></FONT>
</P>

<P><FONT SIZE=3D2><Script runat=3D"server"></FONT>
</P>

<P><FONT SIZE=3D2>   =
SmptMail.Send("Click here to reveal e-mail address","Click here to reveal e-mail address",&quo=
t;My Subject","This is my</FONT>
<BR><FONT SIZE=3D2>body")</FONT>
</P>

<P><FONT SIZE=3D2></Script></FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Trying to run the page gives error saying that =
SmptMail is not declared.  I</FONT>
<BR><FONT SIZE=3D2>can create a simple file with the necessary info and =
save it in the</FONT>
<BR><FONT SIZE=3D2>c:\inetpub\mailroot\pickup directory and it is sent =
successfully so I think</FONT>
<BR><FONT SIZE=3D2>my SMTP is up and running.  Any ideas =
anyone?</FONT>
</P>

<P><FONT SIZE=3D2>Austin</FONT>
</P>

<P><FONT SIZE=3D2>| [ngfx-mail] member Click here to reveal e-mail address =3D YOUR =
ID</FONT>
<BR><FONT SIZE=3D2>| <A =
HREF=3D"http://www.aspfriends.com/aspfriends/ngfx-mail.asp" =
TARGET=3D"_blank">http://www.aspfriends.com/aspfriends/ngfx-mail.asp</A>=
=3D JOIN/QUIT</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
    
Austin Castro
okay,

My fault... sleepy I guess. I was missing an ending double quote when
defining the namespace.

Sorry :-)

-----Original Message-----
From: Austin Castro [mailto:Click here to reveal e-mail address]
Sent: Sunday, June 23, 2002 7:04 PM
To: ngfx-mail
Subject: [ngfx-mail] SMTP.SendMail Problem

-- Moved from [aspfreeforall] to [ngfx-mail] by Marcie Jones
<Click here to reveal e-mail address> --

I cannot get my sendmail asp.net page to work.

The following is the code:

<%@ Import namespace="System.Web.Mail" %>

<Script runat="server">

SmptMail.Send("Click here to reveal e-mail address","Click here to reveal e-mail address","My Subject","This is my
body")

</Script>

Trying to run the page gives error saying that SmptMail is not declared. I
can create a simple file with the necessary info and save it in the
c:\inetpub\mailroot\pickup directory and it is sent successfully so I think
my SMTP is up and running. Any ideas anyone?

Austin

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

Reply to this message...
 
 
System.Web.Mail.MailMessage
System.Web.Mail.SmtpMail




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification