使用vb.net从我的asp.net应用程序发送电子邮件 [英] sending email from my asp.net application using vb.net

查看:82
本文介绍了使用vb.net从我的asp.net应用程序发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的代码尝试发送电子邮件但是没有用,我从主机公司获得了邮件服务器和端口。

i used the code below to try sending an e mail but did'nt work, I've gotten the mail server and port from my host company.

 

  Dim message As New MailMessage("sender @ address","来自@ address","Subject","Message Text"))
        ;  Dim emailClient As New SmtpClient("电子邮件服务器名称")

        emailClient.Send(message)

  Dim message As New MailMessage("sender@address", "from@address", "Subject", "Message Text")
        Dim emailClient As New SmtpClient("Email Server Name")
        emailClient.Send(message)

推荐答案

您是否尝试使用TELNET发送电子邮件?结果是什么?

Have you tried to send email using TELNET? what's the result?

在您的代码中,您是否尝试过指定主机名,端口,enableSSL 等?尝试把try ... catch块看看它会抛出什么错误。

In your code, have you tried specifiying the host name, port, enableSSL etc? Try put try...catch blocks and see what error it throws.


这篇关于使用vb.net从我的asp.net应用程序发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆