By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,401 Members | 820 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,401 IT Pros & Developers. It's quick & easy.

Sending e-mail

100+
P: 190
can i create an application to send email from vb ?
Feb 4 '08 #1
Share this Question
Share on Google+
10 Replies


debasisdas
Expert 5K+
P: 8,127
Yes you can do that .
Feb 4 '08 #2

100+
P: 190
van you give me hint sir ? i want to create autoreply email application
Feb 4 '08 #3

debasisdas
Expert 5K+
P: 8,127
van you give me hint sir ? i want to create autoreply email application
Please find a related discussion here .
Feb 4 '08 #4

jamesd0142
100+
P: 469
Here's a working example in vb.net
Expand|Select|Wrap|Line Numbers
  1. Try
  2.  
  3.             Dim EMsg As New System.Net.Mail.MailMessage
  4.             EMsg.From = New System.Net.Mail.MailAddress("Fromaddress")
  5.             EMsg.To.Add("toaddress")
  6.             EMsg.Subject = "Test"
  7.             EMsg.Body = "Hello"
  8.             Dim smtp As New System.Net.Mail.SmtpClient("Server", port)
  9.             smtp.EnableSsl = True
  10.             If My.User.IsAuthenticated = True Then
  11.                 smtp.UseDefaultCredentials = False
  12.                 smtp.Credentials = New System.Net.NetworkCredential("login", "password")
  13.             End If
  14.  
  15.             '--------
  16.             Dim att As Attachment
  17.             att = New Attachment(Path & "MRF.zip")
  18.             EMsg.Attachments.Add(att)
  19.             '----------
  20.             smtp.Send(EMsg)
  21.             'MsgBox("Mail Sent")
  22.         Catch Send_Mail As Exception
  23.             MsgBox(Send_Mail.ToString)
  24.         End Try
  25.  
Feb 4 '08 #5

100+
P: 190
I have put MAPI but it starts outlook cinfiguration .........?
Feb 4 '08 #6

debasisdas
Expert 5K+
P: 8,127
I have put MAPI but it starts outlook cinfiguration .........?
outlook must be configured for that .

The code uses the outlook account to send the mail.
Feb 4 '08 #7

P: 58
i want to create autoreply email application
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?

Tools -> Rules Wizard
Feb 4 '08 #8

100+
P: 190
Can you pls tell me can i set autoresponding in outlook ?
Feb 5 '08 #9

debasisdas
Expert 5K+
P: 8,127
Can you pls tell me can i set autoresponding in outlook ?
Do you have outlook configured on your system ?
Feb 5 '08 #10

P: 17
Private Sub Command1_Click()
Dim email
Set email = CreateObject("cdo.message")

With email
.to = "someone@domain.com"
.cc = "someone@domain.com"
.subject = "something"
.From = "someone@domain.com"
.textbody = "Some thing"
.AddAttachment ("C:\aspsmartupload.dll")
.send
End With


End Sub
Feb 5 '08 #11

Post your reply

Sign in to post your reply or Sign up for a free account.