M
martin
Hi,
I have created a class that is totally seperate from my web application.
However this class is used extensivly by the web application for stuff like
data access.
I wish to add a function to this class that will send email, however my
class will not seem to recognise the
system.web.mail.mailmessage.
my first impression on this is that I may have to use some sort of third
part mail component to send mail from inside my class,
however I am baffled why the class will not recognise the
system.web.mail.mailmessage namespace
The code that I normally use to send mail is listed below, this does not
work from inside my class
Dim Message As System.Web.Mail.MailMessage = New
System.Web.Mail.MailMessage
Dim SmtpMail As System.Web.Mail.SmtpMail
Message.To = strEmailAddress
Message.From = txtFrom.Text
Trace.Warn("FROM ADDRESS", txtFrom.Text)
Message.Subject = txtSubject.Text
Message.Body = strSendEmailText
Message.BodyFormat = Mail.MailFormat.Html
SmtpMail.SmtpServer = "saturn"
SmtpMail.Send(Message)
any help is greatly appreciated
cheers
martin.
I have created a class that is totally seperate from my web application.
However this class is used extensivly by the web application for stuff like
data access.
I wish to add a function to this class that will send email, however my
class will not seem to recognise the
system.web.mail.mailmessage.
my first impression on this is that I may have to use some sort of third
part mail component to send mail from inside my class,
however I am baffled why the class will not recognise the
system.web.mail.mailmessage namespace
The code that I normally use to send mail is listed below, this does not
work from inside my class
Dim Message As System.Web.Mail.MailMessage = New
System.Web.Mail.MailMessage
Dim SmtpMail As System.Web.Mail.SmtpMail
Message.To = strEmailAddress
Message.From = txtFrom.Text
Trace.Warn("FROM ADDRESS", txtFrom.Text)
Message.Subject = txtSubject.Text
Message.Body = strSendEmailText
Message.BodyFormat = Mail.MailFormat.Html
SmtpMail.SmtpServer = "saturn"
SmtpMail.Send(Message)
any help is greatly appreciated
cheers
martin.