Click here to Skip to main content
15,881,715 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: .Net Certification Pin
Thomas Daniels21-Aug-13 21:26
mentorThomas Daniels21-Aug-13 21:26 
GeneralRe: .Net Certification Pin
Chandra Sekhar.bs22-Aug-13 19:22
professionalChandra Sekhar.bs22-Aug-13 19:22 
AnswerRe: .Net Certification Pin
Thomas Daniels22-Aug-13 21:02
mentorThomas Daniels22-Aug-13 21:02 
Questionhi Pin
Member 1022459421-Aug-13 20:53
Member 1022459421-Aug-13 20:53 
Questionsent email vb.net Pin
chew9321-Aug-13 7:59
chew9321-Aug-13 7:59 
QuestionRe: sent email vb.net Pin
jkirkerx21-Aug-13 10:54
professionaljkirkerx21-Aug-13 10:54 
AnswerRe: sent email vb.net Pin
chew9321-Aug-13 17:59
chew9321-Aug-13 17:59 
AnswerRe: sent email vb.net Pin
jkirkerx22-Aug-13 10:25
professionaljkirkerx22-Aug-13 10:25 
You use netmail, the mailclient and mail exception to track errors

Dim NetMail As New MailMessage
Dim MailClient As New SmtpClient
Dim smtp_credentials As Net.NetworkCredential = Nothing
Dim mailException As New SmtpException

Then you create your target, subject, encoding and so forth.
  NetMail.From =  _
New MailAddress(smtpC.Options_WebsiteName & " <" & smtpC.Options_ReplyTo & ">")
NetMail.ReplyToList.Add(New MailAddress(smtpC.Options_WebsiteName & " < " & smtpC.Options_ReplyTo & " > "))
NetMail.To.Add(New MailAddress(m_CustomerName & "<" & m_EmailAddress & ">"))
NetMail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
NetMail.IsBodyHtml = True
NetMail.BodyEncoding = System.Text.Encoding.UTF8
NetMail.Priority = MailPriority.Normal
NetMail.Subject = m_RM.GetString("Confirmation of Payment for Order Number") 

If your message is HTML, use the NetMail.Body. YOur Body can be any mix and match of properly formatted HTML code, packaged as a string or use can use a string Builder.tostring
NetMail.Body = html_Template.ToString

This part is tricky, I've been playing around with this for a couple of months now, and I think I have it now. I've had to adjust sending credentials to exchange servers in a windows domain, and plain smtp servers outside the domain.
select case smtpC.Connector_AuthMethod.ToUpper
Case "WINDOWS"
   If (Convert.ToBoolean(smtpC.Connector_DefaultCredentials) = True) Then
     MailClient.UseDefaultCredentials = True
   Else
     MailClient.UseDefaultCredentials = False
     smtp_credentials = New Net.NetworkCredential
     smtp_credentials.Domain = smtpC.Credentials_DomainName
     smtp_credentials.UserName = smtpC.Credentials_LoginID
     smtp_credentials.Password = smtpC.Credentials_Password
     MailClient.Credentials = smtp_credentials
   End If

   Case "SMTP"
    MailClient.UseDefaultCredentials = False
    smtp_credentials = New Net.NetworkCredential
    smtp_credentials.Domain = smtpC.Credentials_DomainName
    smtp_credentials.UserName = smtpC.Credentials_LoginID
    smtp_credentials.Password = smtpC.Credentials_Password
    MailClient.Credentials = smtp_credentials


Now I set the port, host and delivery method and send the message
MailClient.DeliveryMethod = SmtpDeliveryMethod.Network
MailClient.Host = smtpC.Connector_ServerAddress
MailClient.Port = smtpC.Connector_SMTP_PortNum
MailClient.Send(NetMail)

And then dispose of the netmail object
If Not (NetMail Is Nothing) Then
   NetMail.Dispose()
   NetMail = Nothing
End If

QuestionUnhandeled Exception, Windows 7, SQL Server 2005 , Windows application , VB.NET Pin
vaibhav.jain820-Aug-13 20:05
vaibhav.jain820-Aug-13 20:05 
AnswerRe: Unhandeled Exception, Windows 7, SQL Server 2005 , Windows application , VB.NET Pin
vaibhav.jain820-Aug-13 20:30
vaibhav.jain820-Aug-13 20:30 
AnswerRe: Unhandeled Exception, Windows 7, SQL Server 2005 , Windows application , VB.NET Pin
Bernhard Hiller20-Aug-13 21:36
Bernhard Hiller20-Aug-13 21:36 
QuestionGridView using ColumnSpan Pin
captainronohio20-Aug-13 9:45
captainronohio20-Aug-13 9:45 
AnswerRe: GridView using ColumnSpan Pin
Anurag Gandhi23-Aug-13 7:36
professionalAnurag Gandhi23-Aug-13 7:36 
QuestionAbout application Pin
Member 1020673520-Aug-13 0:02
Member 1020673520-Aug-13 0:02 
AnswerRe: About application Pin
Anurag Sinha V29-Aug-13 23:02
Anurag Sinha V29-Aug-13 23:02 
QuestionHow to Capture Selection area in webpage Pin
ansriharsha18-Aug-13 21:15
ansriharsha18-Aug-13 21:15 
AnswerRe: How to Capture Selection area in webpage Pin
Joezer BH18-Aug-13 22:42
professionalJoezer BH18-Aug-13 22:42 
GeneralRe: How to Capture Selection area in webpage Pin
ansriharsha19-Aug-13 19:08
ansriharsha19-Aug-13 19:08 
AnswerRe: How to Capture Selection area in webpage Pin
Joezer BH20-Aug-13 0:28
professionalJoezer BH20-Aug-13 0:28 
GeneralRe: How to Capture Selection area in webpage Pin
ansriharsha21-Aug-13 2:21
ansriharsha21-Aug-13 2:21 
GeneralRe: How to Capture Selection area in webpage Pin
Joezer BH21-Aug-13 2:27
professionalJoezer BH21-Aug-13 2:27 
QuestionHow to sort GridView but not via SQL or a datatable VB 2010 Pin
QuickBooksDev18-Aug-13 4:32
QuickBooksDev18-Aug-13 4:32 
AnswerRe: How to sort GridView but not via SQL or a datatable VB 2010 Pin
Blikkies19-Aug-13 0:30
professionalBlikkies19-Aug-13 0:30 
GeneralRe: How to sort GridView but not via SQL or a datatable VB 2010 Pin
Forbiddenx21-Aug-13 1:09
Forbiddenx21-Aug-13 1:09 
Questionhow to implement azure with .net Pin
codemaniac917-Aug-13 10:59
codemaniac917-Aug-13 10:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.