Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How can i send mail from hmailSserver to a SharePoint library ? I work on Windows Server 2008. When an email is sent from Outlook I can't find it in the library..

share|improve this question
    
Did you setup incoming email for the sharepoijnt server? if so please specify the config: SP SMTP: email Alias hMailServer: Configuration of Domains SharePoint: Incoming Email Setting from CA –  Marco Scheel Dec 18 '12 at 15:17
    
Add SMTP logging (in IIS) and check if emails are droped into the drop folder on sharepoint. Check ULS Logs. The OWS Timer will report is a email was proccessed. Turn up trace level logging to se what the excact problem is. and report back –  Marco Scheel Dec 18 '12 at 15:19

2 Answers 2

up vote 5 down vote accepted

I use hMailServer with Sharepoint.

Since I have worked with this to a good degree, I have a few threads in these forums that would be of service to you:

Now, I'll tell you that there is a bit of a trick to it. You have to configure hMailServer with a vbs script to drop the mail into a location where SharePoint can pick it up. In my posts there is a link to the script to use for hMailServer. You also need to make sure you have configured your mail pickup in SharePoint's Central Administration. In my case, hMailServer was on one machine and SharePoint on another. So I also had to configure a shared directory between the two machines to use as the dropoff folder.

There is also a thread in the hMailServer forum about this.

[update]

In Central Administration > System Settings > Configure Incoming Email there is a place to designate where your "E-mail drop folder" is. This is where you want hMailServer to put is messages. SharePoint will take any messages you put in that folder and sift them and deliver them to the appropriate lists.

The best way, with hMailServer is to add a subdomain. Say your primary domain is mydomain.com where your email address would be me@mydomain.com. In hMailServer, create a second one called portal.mydomain.com where email for the portal lists would be list1@portal.mydomain.com. Now, in the vbs script, you look for any messages going to the subdomain and move them to the drop folder for SharePoint to pick up.

However, you also have to go into the list's own settings and enable it to receive email there.

Since you are enabling email for lists, you should also set up the SMTP Virtual Server on the machine hosting SharePoint. This is what IIS6 is for. You point it to your hMailServer using the subdomain mentioned above. That will allow your portal to SEND email, too. I posted links to directions on how to configure IIS6 in this thread.

Another thing you need to do, if you haven't already, is to configure your DNS Server with an mx record to use hMailServer as the mail handler. There is more information about this in the hMailServer forum.


Here path is C:\inetpub\mailroot\Drop.

Is that path accessible to both hMailServer AND SharePoint? Did you set that path in SharePoint's SCA as I mentioned above?

share|improve this answer
1  
Thanks for your reply. I have added this code in vb script. –  Rajesh Joshi Dec 19 '12 at 5:49
    
@RajeshJoshi - Just curious, what exactly was the fix? –  BGM Dec 21 '12 at 15:21

Thanks for your reply. I have added this code in vb script.

Sub OnDeliverMessage(oMessage) Dim path, filename, fso, original, copy path = Split(oMessage.Filename, "\", -1, 1)

filename = "C:\inetpub\mailroot\Drop\" & _
       path(UBound(path))

Set fso = CreateObject("Scripting.FileSystemObject")

Set copy = fso.CreateTextFile(filename, True)
   copy.WriteLine("x-sender: " & oMessage.FromAddress)
    copy.WriteLine("x-receiver: " & oMessage.To)

Set original = fso.OpenTextFile(oMessage.Filename, 1)
    copy.WriteLine(original.ReadAll)

copy.Close
original.Close

End Sub..

Here path is C:\inetpub\mailroot\Drop. I checked permission. It is Ok. In CA, I configured incoming mail setting and give same Path but still not working. Can you elaborate your answer? Is it necessary to start smtp in iis 6.0. I can't start it.

share|improve this answer
2  
This is very helpful –  Vikalp Kapadiya Dec 19 '12 at 10:56
    
You don't have to start IIS SMPT. Do emails get dropped into the Folder? If yes are they deleted some time later? If yes, you can check the ULS logs and see if th e message was processed. Please notice: This should be a comment or an edit on BGM's answer. This is not an answer please fix this. –  Marco Scheel Dec 19 '12 at 11:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.