I'm hosting a site, but only by means of the www A record pointed to my server. The site has a contact form which uses umbraco.library:SendMail() to generate an enquiry email to an administrator.
Trouble is, because I'm not hosting the mail service on this domain, simply adding host/username/password settings in the mail config settings in web.config results in no mail being sent. What I need to do is drop the mail into the C:\Inetpub\mailroot\Pickup directory, from where the local SMTP service will deal with it.
Question is, how do I set this up. Are there some settings in web.config I can use, or will it require more serious hacking?
its probably way to late but for anybody else's reference, it seems like gmail dosn't work with SMTP in umbraco - I used my gmail settings and got an error logged saying: "5.7.0 Must issue a STARTTLS cmmand first". Somebody tell me if I'm wrong :)
Hey Max, i think the problem with gmail is https config. I'll tried it and it works with cultivform. But i'm having problems with the umbraco send to publish.
My problem was solved thanks the post Users and Send to publish. Really important the advice about the notifications, you can find that option in the contextual menu in any page of the content site.
Send mail using local IIS SMTP
Hi,
I'm hosting a site, but only by means of the www A record pointed to my server. The site has a contact form which uses umbraco.library:SendMail() to generate an enquiry email to an administrator.
Trouble is, because I'm not hosting the mail service on this domain, simply adding host/username/password settings in the mail config settings in web.config results in no mail being sent. What I need to do is drop the mail into the C:\Inetpub\mailroot\Pickup directory, from where the local SMTP service will deal with it.
Question is, how do I set this up. Are there some settings in web.config I can use, or will it require more serious hacking?
Thanks!
To add... I've tried the following:
But nothing seems to make it into the pickup directory at all.
Any ideas?
Have you checked the umbracoLog table?
Yeah, nothing gets written into there when I submit the form. Should it?
Edit: actually, I've tried a few times now and the following has appeared in the log:
umbraco.library.SendMail: Error sending mail. Exception: System.Net.Mail.SmtpException: Failure sending mail. ---> System.UnauthorizedAccessException: Access to the path 'C:\Inetpub\mailroot\Pickup\b317f6d1-77d7-4185-92a6-f86374da32ea.eml' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at System.Net.Mail.SmtpClient.GetFileMailWriter(String pickupDirectory)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at umbraco.library.SendMail(String FromMail, String ToMail, String Subject, String Body, Boolean IsHtml) in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\library.cs:line 1800
Does anyone know how I get around this permissions issue?
Thanks
I've just tried ditching this approach and using gmail as an SMTP server instead, with the following settings:
Still nothing. No error in the log (unless something is caching and the errors aren't being generated?) and no mail at the recipient.
Hi,
its probably way to late but for anybody else's reference, it seems like gmail dosn't work with SMTP in umbraco - I used my gmail settings and got an error logged saying: "5.7.0 Must issue a STARTTLS cmmand first". Somebody tell me if I'm wrong :)
Max.
Hey Max, i think the problem with gmail is https config. I'll tried it and it works with cultivform. But i'm having problems with the umbraco send to publish.
Jorge
My problem was solved thanks the post Users and Send to publish. Really important the advice about the notifications, you can find that option in the contextual menu in any page of the content site.
Greetings.
Jorge
is working on a reply...