View Full Version : sending an asp.net mail


wagae
08-02-2006, 05:51 AM
Hi everyone. please help me, i am trying to send an email from a web form in asp.net
this is what i have

Dim objMM As New MailMessage

objMM.To = "mail@mymail.com"
objMM.From = "mail@mymail.com"

objMM.Cc = "mail@mymail.com"
objMM.Bcc = "mail@mymail.com"

objMM.BodyFormat = MailFormat.Text
objMM.Priority = MailPriority.Normal

objMM.Subject = "Hello!"

objMM.Body = "Please NOTE" & vbCrLf & vbCrLf & "testing email."
SmtpMail.Send(objMM)
when debugging, everything is right until the
SmtpMail.Send(objMM), i get this "Expression does not produce a value."
am i doing something wrong?
thank you

dan-cat
08-02-2006, 08:55 AM
You haven't created your SmtpMail object

Dim objMM As New MailMessage
Dim mySMTP As New SmtpMail

objMM.To = "mail@mymail.com"
objMM.From = "mail@mymail.com"

objMM.Cc = "mail@mymail.com"
objMM.Bcc = "mail@mymail.com"

objMM.BodyFormat = MailFormat.Text
objMM.Priority = MailPriority.Normal

objMM.Subject = "Hello!"

objMM.Body = "Please NOTE" & vbCrLf & vbCrLf & "testing email."

mySMTP.Send(objMM)

mercy
08-03-2006, 08:40 PM
I dont think that by using this solution, u get the remedy.

dan-cat
08-04-2006, 04:53 AM
I think you're right - here is an article (http://www.systemwebmail.com/faq/4.2.2.aspx) that addresses the issue