简体   繁体   中英

How to Sending an email from vb.net console application when a process fails

I am using gmail account to send email...when process fail...like this

 Dim SimpleSMTP As New SmtpClient("smtp.gmail.com") 
        With SimpleSMTP 
            .Port = 587 
            .EnableSsl = True 
            .Credentials = _ 
            New NetworkCredential("mytest@gmail.com", "passtest") 
            .Send(AnEmailMessage) 
        End With

I want to replace this snippet with real smtp details...ussmtp.mysite.com How to do it?

You would just change the URL from "smtp.gmail.com" to "ussmtp.mysite.com" , make sure the port is appropriate, and setup the credentials as needed.

Otherwise, the code as written should work with any SMTP server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM