English 中文(简体)
如何在使用SmtpClient和RomMessage时压制电子邮件的确认
原标题:How to suppress email validation when using SmtpClient and MailMessage

在发出电子邮件时,使用SmtpClient和邮递Message(www.net 3.5)“To”电子邮件地址在发送之前就得到了验证。 我在寄信之前就翻了一番多的电子邮件地址,在你试图用SmtpClient发出电文时,就形成了一种形式。 这实际上是一件好事,因为,在签字之前,一只狗被指定为无效。 不幸的是,这些电子邮件在现实世界中存在,如果你利用你喜欢的电子邮件客户寄出,这些电子邮件就会送达。

我的问题是,能否通过SmtpClient/mailMessage进行电子邮件验证?

最佳回答

这在发出电子邮件后可能是错误的。

你们能够提供一些“呼吁书”,以便我们能够看到哪里出现了完全例外的情况。


Update: According to the disassemble code from reflector, this problem can be sold only by upgrading to the VS2010 and .NET 4.0

系统版本较低。 集会网无法解决这一问题。

问题回答

Edit:在VB2005年把样本编码放在一起,我也例外。 下面的法典在VB2010年快车上课以罚款,但看来是现在固定的。 MSDN 引用的是4.0英才华,该氮并非先前版本的MSDN网页。

现在我可以尝试,但你电子邮件地址是如何格式的? <代码> 邮件/地址类别的文件指出,它支持用户名中的执行和跟踪犬。 例如,用户名称:@host.。 (引自here。)

Edit: 添加样本。

Try
    Dim smtpClient As New SmtpClient()
    smtpClient.Host = "mailserver"
    Dim fromAddress As New MailAddress("from@test.com")
    Dim toAddresses As New MailAddress("test.test.@test.com")
    Using message As New MailMessage()
         message.From = fromAddress
         message.To.Add(toAddresses)

         message.IsBodyHtml = False
         message.Subject = "test"
         smtpClient.Send(message)
    End Using
    TextBox1.Text = "OK"
Catch ex As SmtpException
    TextBox1.Text = ex.ToString()
End Try




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签