Solved

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

Posted on 2011-03-08
6
373 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
ID: 35072121
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
ID: 35072166
Yes its good but it does not work when using vpn client? The app must work over vpn
0
 
LVL 33

Expert Comment

by:it_saige
ID: 35072434
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

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

Accepted Solution

by:
MarkStepp earned 500 total points
ID: 35072854
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 33

Expert Comment

by:it_saige
ID: 35161236
Dabosa,

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

-saige-
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

27 Experts available now in Live!

Get 1:1 Help Now