Solved

System.Net.Mail or 3rd part SMTP component?

Posted on 2011-03-08
6
372 Views
Last Modified: 2012-05-11
Im using VS2010 and VB.net. I want to send emails with attachments in my application.
The app we are using currently is written in VB6 and is using MSMAPI32.OCX and MSWINSCK.OCX to send emails, this works without specifying SMTP server. I cannot specify SMTP sever as our organisation does not permit relay, so I assume its doing some DNS lookups. As I understand I cannot use these active x components or any other for that matter that is targeting .net 4 assemblies?

Its really frustrating that VB6 could manage this and VB.net 4 cannot!

Now I'm testing 3rd party SMTP components like EAsendmail and Easymail, but these cannot manage to send the email when connected with a vpn client for some reason.

All emails are being send internally.

Is there a way to use DNS lookup to send emails with any method with VS2010 4 framework?
System.Net.Mail  seems to be great when using SMTP server, but when not it seems to be useless?

Any suggestions would be appreciated?
Thanks
Dab
0
Comment
Question by:Dabosa
  • 2
  • 2
  • 2
6 Comments
 
LVL 1

Expert Comment

by:MarkStepp
Comment Utility
We have used ANSMTP for years and love the configurablity of the product.  you can download a sample from http://www.emailarchitect.net/easendmail/  and I think it will do what you are requesting.
0
 

Author Comment

by:Dabosa
Comment Utility
Yes its good but it does not work when using vpn client? The app must work over vpn
0
 
LVL 32

Expert Comment

by:it_saige
Comment Utility
Just in case you have not already explored this avenue.  How about using MAPI and WINSOCK in your updated program?

Have you also ruled out CDO?

http://xpode.com/ShowArticle.aspx?Articleid=271

-saige-
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:Dabosa
Comment Utility
Thanks, any sampels for use of mapi and winsock?
0
 
LVL 1

Accepted Solution

by:
MarkStepp earned 500 total points
Comment Utility
Here is some code we have used with CDO...


<%@ Language=VBScript %>
<%
	'used to call the sub
	SendEmail()


'sub to send email
sub SendEmail()
	Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
	objCDOMail.From = "Your Name <YourEmail@YourDomain.com>"	
	objCDOMail.To = tEmail
	objCDOMail.Bcc = "sales@mark-it-systems.com"
	objCDOMail.Subject = "Your Subject Goes Here!!!"
	tBody = "<b>Thank you</b> for your order!<br><br>"
	tBody = tBody + "This is where the Email Body Goes<br>"
	tBody = tBody + "If you need additional assistance send emails to <a href='mailto:YourEmail@YourDomain.com'>YourEmail@YourDomain.com</a><br><br><br>"
	objCDOMail.BodyFormat=0
	objCDOMail.MailFormat=0
	objCDOMail.Body = tBody

	On Error Resume Next
	objCDOMail.Send
	Set objCDOMail = Nothing
end sub

%>

Open in new window

0
 
LVL 32

Expert Comment

by:it_saige
Comment Utility
Dabosa,

I have not found anything as of yet, but I am still looking.

-saige-
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now