1

I've deployed an Reporting website on our intranet environment. Now my TL wants me to send emails using this. But Our company doesn't provide me the SMTP details.

Can i send it by any means?

Like using DNS, or any other option..

Nishant Jain
  • 19
  • 1
  • 5
  • If you're sending emails outside of your organisation then you'll most likely need to use SMTP, even if this mean talking to the destination's email server. If it's internal email, depending on the email system your company uses, you may be able to drop emails into people's mailboxes some other way. – Adrian Thompson Phillips Apr 26 '13 at 12:31
  • Yes, there is - what have you tried? Some libraries provide direct email via DNS, there are web services available or you can use your own SMTP server (not the company's).. – Kieren Johnstone Apr 26 '13 at 12:31
  • http://stackoverflow.com/questions/16153350/send-email-without-using-smtp – Sam Leach Apr 26 '13 at 12:32
  • [using html form tag](http://www.html-form-guide.com/email-form/email-form-mailto.html) – mojtaba Apr 26 '13 at 12:34
  • 6
    You've had two sets of conflicting constraints placed on you by two higher authorities. I'd say that it's down to your "TL" to discuss with "Our Company" rather than to leave you guessing. – spender Apr 26 '13 at 12:38
  • @spender - Yep your right. – Arun Apr 26 '13 at 12:40
  • "But Our company doesn't provide me the SMTP details" Sounds odd... If "Out Company" has email, they have an email server and certainly an MX record in the DNS entry. – rioki Apr 26 '13 at 12:58
  • An alternative would be to place the reports on a shared drive instead of mailing everybody. This way you only have to worry about who can access the folder instead of maintaining a mailing list. – Deruijter Apr 26 '13 at 13:05
  • Get the details of an Exchange server, set up a profile and then use it. http://www.codeproject.com/Articles/455823/Managed-MAPI-Part-1-Logon-MAPI-Session-and-Retriev – ta.speot.is Apr 26 '13 at 13:07
  • When did we establish that he has an exchange server? – msmucker0527 Apr 26 '13 at 13:26
  • @msmucker0527 He's asking how to send email by other means. When did we determine he had any other means? It's a suggestion, based on the fact that he's in a corporate environment. – ta.speot.is Apr 26 '13 at 13:34

1 Answers1

3

So you want to send email without not using the Simple Mail Transfer Protocol? I am not sure what you mean with that. What you probably mean is, you want to send mail without a mail transfer agent (MTA) installed on a dedicated server, aka "SMTP-Server". That is totally possible, firewall and filter settings aside.

E-Mail was designed to be sent from one computer to any other computer. For that to work, the receiving host needs a service to listen for mails and the sending host just opens a TCP connection to that host and sends it a message; using the SMTP protocol. What you need is your program to implement the SMTP protocol.

You probably don't want to implement the protocol yourself, but there are lots of libraries out there that do that for you. I don't know any good ones for C#, you I can't help you there.

But there is the catch, it may still not work. In the effort to curb SPAM, firewall and MTA administrators will drop any messages from hosts they don't trust. This is especially true for "client" systems. So it depends on your environment, you may want to add a real MTA in the middle or if that is possible add your host to the white list of hosts that may deliver email.

As a note: If you want to send an email to jane@company.com, you don't send a message to jane's computer, you send it to company.com's mail server. That is either a server that answers under company.com or the MX entry in the DNS record. But if you use a third party library, you should not need to worry about that.

Addendum:

Finally as @ta.speot.is points out, in an exchange environment you may also encounter the MAPI protocol. The basic gist is the same, you need to integrate a MAPI library into your application. In this case you will need even more certainly talk to the admins, since they will probably not let a, to them, unknown server talk to the exchange infrastructure.

rioki
  • 5,988
  • 5
  • 32
  • 55
  • It would pay to note that email gets sent without SMTP all the time. Inside a corporate LAN (which this gentleman appears to be) I'd be willing to bet close to 100% of email is being delivered via Microsoft's proprietary MAPI stuff, using Exchange Server. So perhaps while the IT guys won't provide an SMTP server, there's a farm of Exchange servers available. All capable of delivering email. – ta.speot.is Apr 26 '13 at 13:03
  • @ta.speot.is Yes, point taken. But then you can "simply" integrate a MAPI library into your application. The basic gist is the same. But then again the question is only sparsely defined. – rioki Apr 26 '13 at 13:08
  • Not really. Your first paragraph is *So you want to send email without not using the Simple Mail Transfer Protocol? That sounds like you want to drive a train without rails..* which makes it sound like sending emails is the exclusive domain of SMTP. Which in any corporate environment, it is not. – ta.speot.is Apr 26 '13 at 13:10
  • @ta.speot.is revised the answer, just for you. ;-) But even with Exchange, at some point they need to understand SMPT or else they can't receive mail from the rest of the world. But that will probably collide with some firewall rules. In our environment we use the SMTP fallback all the time, since our admins will not let our apps talk with the exchange servers properly. The mails are then treated like any foreign source. – rioki Apr 26 '13 at 13:24
  • Yes and at that point it's no longer OP's problem. So that's orthogonal to the question at hand: "how do I send mail in a corporate environment without SMTP". A treatise about how SMTP would work in this scenario is not an answer. – ta.speot.is Apr 26 '13 at 13:33
  • @ta.speot.is Are we second guessing OP's question? Unless OP expands his question to encompass the requirement that the admins have locked down SMTP and are running an exchange infrastructure, this remains a valid answer. – rioki Apr 26 '13 at 13:40