mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
@@ -7,6 +7,7 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Security;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Orchard.Email.Handlers {
|
||||
[UsedImplicitly]
|
||||
@@ -47,6 +48,8 @@ namespace Orchard.Email.Handlers {
|
||||
var encryptedPassword = String.IsNullOrWhiteSpace(value) ? String.Empty : Convert.ToBase64String(_encryptionService.Encode(Encoding.UTF8.GetBytes(value)));
|
||||
part.Store(x => x.Password, encryptedPassword);
|
||||
});
|
||||
|
||||
part.AddressPlaceholderField.Loader(value => (string)((dynamic)ConfigurationManager.GetSection("system.net/mailSettings/smtp")).From);
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
@@ -19,6 +19,10 @@ namespace Orchard.Email.Models {
|
||||
set { this.Store(x => x.Address, value); }
|
||||
}
|
||||
|
||||
private readonly LazyField<string> _addressPlaceholder = new LazyField<string>();
|
||||
internal LazyField<string> AddressPlaceholderField { get { return _addressPlaceholder; } }
|
||||
public string AddressPlaceholder { get { return _addressPlaceholder.Value; } }
|
||||
|
||||
public string Host {
|
||||
get { return this.Retrieve(x => x.Host); }
|
||||
set { this.Store(x => x.Host, value); }
|
||||
|
@@ -1,17 +1,14 @@
|
||||
@using System.Configuration
|
||||
@using System.Net.Mail
|
||||
@using System.Net.Mail
|
||||
@model Orchard.Email.Models.SmtpSettingsPart
|
||||
@{
|
||||
var smtpClient = new SmtpClient();
|
||||
|
||||
dynamic section = ConfigurationManager.GetSection("system.net/mailSettings/smtp");
|
||||
}
|
||||
|
||||
<fieldset>
|
||||
<legend>@T("Email")</legend>
|
||||
<div>
|
||||
<label for="@Html.FieldIdFor(m => m.Address)">@T("Sender email address")</label>
|
||||
@Html.TextBoxFor(m => m.Address, new { @class = "text medium", placeholder = (string) section.From })
|
||||
@Html.TextBoxFor(m => m.Address, new { @class = "text medium", placeholder = Model.AddressPlaceholder })
|
||||
@Html.ValidationMessage("Address", "*")
|
||||
<span class="hint">@T("The default email address to use as a sender.")</span>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user