Re: send mail with remote smtp
From: ratnesh (ratneshraval_at_yahoo.com)
Date: 07/09/04
- Next message: Nunthie: "Add Refernece to ASP.NET project"
- Previous message: crawlerxp: "Re: A remote service problem"
- In reply to: Jos: "Re: send mail with remote smtp"
- Next in thread: Jos: "Re: send mail with remote smtp"
- Reply: Jos: "Re: send mail with remote smtp"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 9 Jul 2004 22:10:41 +0530
please help me
WebForm1.aspx.vb(45): 'Fields' is not a member of
'System.Web.Mail.MailMessage'.
this error is showing up.
thanks
"Jos" <josnospambranders@fastmail.fm> wrote in message
news:#d3L19cZEHA.2260@TK2MSFTNGP12.phx.gbl...
> ratnesh wrote:
> > hi,
> >
> > how can i send smtp mail from my asp.net webform.
> > i give the smtp server name,
> > but the server is remote and it requires authentication (login) to
> > send mail.
> > i dont know how to do that
>
> Try something like this:
>
> Dim oMail As MailMessage = New MailMessage()
> oMail.To = someone@somedomain.com
> oMail.From = someoneelse@somedomain.com
> oMail.Subject = "Important message"
> oMail.Body = "Your message here."
>
oMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverp
> ort",25)
>
oMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing",
> 2)
>
oMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthent
> icate",2)
>
oMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusernam
> e","yourusername")
>
oMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpasswor
> d","yoursecretpassword")
> SmtpMail.SmtpServer = "smtp.yourserver.com"
> SmtpMail.Send(oMail)
>
> --
>
> Jos
>
>
- Next message: Nunthie: "Add Refernece to ASP.NET project"
- Previous message: crawlerxp: "Re: A remote service problem"
- In reply to: Jos: "Re: send mail with remote smtp"
- Next in thread: Jos: "Re: send mail with remote smtp"
- Reply: Jos: "Re: send mail with remote smtp"
- Messages sorted by: [ date ] [ thread ]