How To Send Email Using Microsoft Outlook Using VB.Net
Có thể bạn quan tâm
حضرت خواجہ سیدنا معین الدین حسن چشتی سنجاری اجمیری رحمۃ اللہ علیہ
- HOME
- BLOGS
- ASP.Net C#.Net JavaScript ADO.Net Excel AJAX VB.Net SQL Server GridView Issues and Exceptions Silverlight Rich Text Editor jQuery DataList Snippets XML New Features .Net 4.0 TreeView AJAX Control Toolkit jQuery Plugins Third Party Controls ASP.Net Validators WCF Repeater Regular Expressions Yahoo API iTextSharp FaceBook Charts ListView Tweeter Google CSS SMS DotNetZip Crystal Reports Entity Framework HyperLink RDLC Report SqlDataSource Menu YouTube Twitter HTML XmlDataSource ListBox Tips DataGridView Cryptography Windows Forms LinkedIn WebUserControl RSS Feeds HTML5 Sitemap IIS LINQ DataPager URL Routing SqlBulkCopy OCR ASP.Net 4.5 Master Pages MySQL CSV Stored Procedures JSON Web Services Bootstrap Windows Service DataTable App.Config Visual Studio RadioButton CheckBox Generic Handler DropDownList FileUpload RadioButtonList CheckBoxList Flash HtmlEditorExtender Div Table AngularJS DataReader DataSet Console Applications FTP DetailsView Password TextBox Enum ComboBox Sponsored SqlDataAdapter OpenXml ClosedXml SiteMapPath Arrays FormView
- FORUMS
- Questions
- Ask Question
- VIDEOS
-
- SEARCH
- INTERVIEW
- Interview Questions
- COMMUNITY
- Users
- CONTACT
Nithin - CLOSED
- User: Nithin
- Posted: on May 21, 2014 07:05 AM
- Forum: ASP.Net Thirdparty controls
- Replies: 5
- Views: 45221
Hi,
Kindly help me out from this issue pls.
i want to send a Email through outlook using vb.net
Explain me step-by-step Coding pls.
its Little Bit Urgent.........
Thanks
Nithin
Azim 0 1 - Reply
- User: Azim
- Replied: on May 21, 2014 07:08 AM
- Report
Refer these links
http://www.codeproject.com/Tips/165548/C-Code-snippet-to-send-an-Email-with-attachment-fr
VB code from the above link
Public Sub sendEMailThroughOUTLOOK() Try ' Create the Outlook application. Dim oApp As New Outlook.Application() ' Create a new mail item. Dim oMsg As Outlook.MailItem = DirectCast(oApp.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem) ' Set HTMLBody. 'add the body of the email oMsg.HTMLBody = "Hello, Jawed your message body will go here!!" 'Add an attachment. Dim sDisplayName As [String] = "MyAttachment" Dim iPosition As Integer = CInt(oMsg.Body.Length) + 1 Dim iAttachType As Integer = CInt(Outlook.OlAttachmentType.olByValue) 'now attached the file Dim oAttach As Outlook.Attachment = oMsg.Attachments.Add("C:\\fileName.jpg", iAttachType, iPosition, sDisplayName) 'Subject line oMsg.Subject = "Your Subject will go here." ' Add a recipient. Dim oRecips As Outlook.Recipients = DirectCast(oMsg.Recipients, Outlook.Recipients) ' Change the recipient in the next line if necessary. Dim oRecip As Outlook.Recipient = DirectCast(oRecips.Add("[email protected]"), Outlook.Recipient) oRecip.Resolve() ' Send. oMsg.Send() ' Clean up. oRecip = Nothing oRecips = Nothing oMsg = Nothing oApp = Nothing 'end of try block Catch ex As Exception End Try 'end of catch End SubYou can refer this link aslo.
http://www.codeproject.com/Articles/14045/Sending-Emails-using-NET-Part-II
Nithin 0 2 - Reply
- User: Nithin
- Replied: on May 21, 2014 11:05 PM
- Report
Hi Azim,
Am Happy with your code
Thanks a lot for your answer
i have some Queries regarding this code
1.for C# we are using port no.587 for vb.net we are not using any port numbers?
2.In this code the attached file will be a .jpg fromat but i want it should be accept all formats (.doc,.txt,etc....)?
Can you please answers my questions that will be more helpfull for me
and make me understandable
Thanks
Nithin
Azim 0 3 - Reply
- User: Azim
- Replied: on May 21, 2014 11:15 PM
- Report
- In outlook there is no any need of port number.
- http://msdn.microsoft.com/en-us/library/ms268870.aspx
Nithin 0 4 - Reply
- User: Nithin
- Replied: on May 21, 2014 11:21 PM
- Report
Hi Azim,
thanks for your quick reply
Azim we have to import dll (Microsoft.Office.Interop.Outlook.dll)
and i have imported that from microsoft and written the code which u referd in codeproject(http://www.codeproject.com/Articles/14045/Sending-Emails-using-NET-Part-II) but its not working
Can you please check and tell me .its little bit urgent pls.
ManyThanks
Nithin
Nithin 0 5 - Reply
- User: Nithin
- Replied: on May 22, 2014 12:12 AM
- Report
Hi,
Can you plz check and let me know the code for sending Email through Outlook express using vb.net
its urgent Azim
Thanks
Nithin
I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html Ask Question
Company
- About us
- Contact us
Explore
- Ask question
- FAQs
- Privacy policy
Follow us
- YouTube
Contact Us
- Email: [email protected]
- Address: ASPSNIPPETS PRIVATE LIMITED G-110, SHAGUN ARCADE, MALAD (EAST), MUMBAI, MAHARASHTRA, INDIA 400097.
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.
Disclaimer This site makes use of Cookies. Please refer Privacy Policy for more details. Allow RejectTừ khóa » Visual Basic Send Email Outlook
-
How To Send Emails From Outlook Using VBA Code? - WallStreetMojo
-
How To: Programmatically Send Email - Visual Studio (Windows)
-
How To Send Emails In Using The Outlook Library
-
VBA Send Emails From Excel Through Outlook
-
Send Outlook Emails With VBA Macros
-
How To Write VBA Code To Send An Outlook Email
-
How To Send An Outlook Email Message Programmatically
-
Send An Email With Outlook Using VB .Net - Visual Basic .NET - Bytes
-
Send Emails With Attachments From Excel Using VBA And Outlook
-
Send E-Mail In VBA Excel Through Microsoft Outlook (Video 1 Of 4)
-
VBA To Automate Sending Email From Excel Table With Attachment ...
-
Sending Email With VBA: Learn In 11 Simple And Easy Steps
-
Send Email Using Hotmail/Live/Outlook/Office 365 In VB.NET