Solved

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

Posted on 2011-03-08
6
378 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Open dialog with server side controls in it 3 46
VB.NET Textbox input validation 4 60
Code enhancement 4 32
YouTube API get the Video Tags - vb.net 7 23
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 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