使用ASP.NET的Outlook Mailsend [英] Outlook Mailsend usingASP.NET

查看:120
本文介绍了使用ASP.NET的Outlook Mailsend的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ASP.NET发送Outlook Mail
使用ASP.NET发送Outlook Mail
使用ASP.NET的Outlook Mail发送
使用ASP.NET的Outlook Mail发送
使用ASP.NET发送Outlook Mail

Outlook Mail send using ASP.NET
Outlook Mail send using ASP.NET
Outlook Mail send using ASP.NET
Outlook Mail send using ASP.NET
Outlook Mail send using ASP.NET

推荐答案

为什么尝试使用Outlook?仅当服务器上安装了Outlook时,它才有效.
相反,请尝试以下操作:使用C#发送电子邮件带有或不带有附件的通用例程. [
Why try to use Outlook? It will only work if you have Outlook installed on the server.
Instead, try this: Sending an Email in C# with or without attachments: generic routine.[^]


Public Sub SendOutlookMail(Subject As String, Recipient As _
String, Message As String)

On Error GoTo errorHandler
Dim oLapp As Object
Dim oItem As Object

Set oLapp = CreateObject("Outlook.application")
Set oItem = oLapp.createitem(0)
'
With oItem
   .Subject = Subject
   .To = Recipient
   .body = Message
   .Send
End With
'
Set oLapp = Nothing
Set oItem = Nothing
'

Exit Sub

errorHandler:
Set oLapp = Nothing
Set oItem = Nothing
Exit Sub
End Sub


这篇关于使用ASP.NET的Outlook Mailsend的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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