can i create an application to send email from vb ?
Sending e-mail
Collapse
X
-
Tags: None
-
-
-
-
Here's a working example in vb.net
[code=vbnet]
Try
Dim EMsg As New System.Net.Mail .MailMessage
EMsg.From = New System.Net.Mail .MailAddress("F romaddress")
EMsg.To.Add("to address")
EMsg.Subject = "Test"
EMsg.Body = "Hello"
Dim smtp As New System.Net.Mail .SmtpClient("Se rver", port)
smtp.EnableSsl = True
If My.User.IsAuthe nticated = True Then
smtp.UseDefault Credentials = False
smtp.Credential s = New System.Net.Netw orkCredential(" login", "password")
End If
'--------
Dim att As Attachment
att = New Attachment(Path & "MRF.zip")
EMsg.Attachment s.Add(att)
'----------
smtp.Send(EMsg)
'MsgBox("Mail Sent")
Catch Send_Mail As Exception
MsgBox(Send_Mai l.ToString)
End Try
[/code]Comment
-
-
outlook must be configured for that .Originally posted by Shalini BhallaI have put MAPI but it starts outlook cinfiguration .........?
The code uses the outlook account to send the mail.Comment
-
What exactly are you trying to accomplish with this "autoreply email application?" When and how will this application be used? Do you want this written in VB 6, VBA, or VB.NET? If you're using Outlook, why not use rules?Originally posted by Shalini Bhallai want to create autoreply email application
Tools -> Rules WizardComment
-
-
Do you have outlook configured on your system ?Originally posted by Shalini BhallaCan you pls tell me can i set autoresponding in outlook ?Comment
-
Private Sub Command1_Click( )
Dim email
Set email = CreateObject("c do.message")
With email
.to = "someone@domain .com"
.cc = "someone@domain .com"
.subject = "something"
.From = "someone@domain .com"
.textbody = "Some thing"
.AddAttachment ("C:\aspsmartup load.dll")
.send
End With
End SubComment
Comment