Posted by: Phil D - Friday, 15 March 2024 10:51:27
Hi,
Currently, it seems that the Email handling is done through web.config for V3.2.2. I'm setting up my Forum in Azure and am having problems with getting the Create New User process out through Azure.
Has anybody encountered this before and could perhaps give me an example web.config to Use.
Thanks in advance.
Phil
Posted by: tha_watcha - Friday, 15 March 2024 11:19:44
Yaf 3.2.2 already includes a sample web.config. You can see it here online... [url]https://github.com/YAFNET/YAFNET/blob/netfx/yafsrc/YetAnotherForum.NET/recommended.web.config[/url]
In the mailSettings section you configure your email
[code=markup]<mailSettings>
<smtp deliveryMethod="Network" from="forumadmin@yourdomain.com">
<network host="localhost" port="587" password="password" userName="username" enableSsl="true" />
</smtp>
</mailSettings>[/code]
From = defines the email address where the emails are send from
host = the smtp host url
Port = The port
username + password = smtp Auth Username + Password
Posted by: Phil D - Monday, 18 March 2024 11:32:18
I' m still not getting an email off my dev laptop when trying to set up a new user. I have the following settings in the web config
And have opened up the port 587 on my laptop.
I am using sendgrid, and the email isnt hitting that yet as I'm checking in the sendgrid portal I have. I have identifie in the code where I think its going wrong, its here as it never appear to come back to the last debug point (verifyEmail.SendEmail). Any ideas greatfully recieved (its V3.2.2)
public void SendVerificationEmail(
AspNetUsers user,
string email,
int? userId,
string newUsername = null)
{
CodeContracts.VerifyNotNull(email);
CodeContracts.VerifyNotNull(user);
var token = HttpUtility.UrlEncode(
this.Get).GenerateEmailConfirmationResetToken(user.Id));
// save verification record...
this.GetRepository).Save(userId, token, user.Email);
var subject = this.Get).GetTextFormatted(
"VERIFICATION_EMAIL_SUBJECT",
this.BoardSettings.Name);
var verifyEmail = new TemplateEmail("VERIFYEMAIL")
{
TemplateParams =
{
["{link}"] = this.Get).GetAbsoluteLink(
ForumPages.Account_Approve,
new {code = token}),
["{key}"] = token,
["{username}"] = user.UserName
}
};
[b]verifyEmail.SendEmail(new MailAddress(email, newUsername ?? user.UserName), subject);[/b]
}
Posted by: tha_watcha - Monday, 18 March 2024 12:02:51
You need to wrap the web.config xml code in a bbcode code block in order to post it....
[ code]content[/code]
Posted by: Phil D - Monday, 18 March 2024 12:10:01
Do you have an example of that please?
Posted by: Phil D - Monday, 18 March 2024 13:05:11
Finally clocked what you meant!
Posted by: Phil D - Monday, 18 March 2024 13:08:39
The blocks dont work - heres the settings
[code=markup]<mailSettings>
<smtp deliveryMethod="Network" from="forumadmin@yourdomain.com">
<network host="smtp.sendgrid.net" port="587" password="SG.XXXX" userName="apikey" enableSsl="true" />
</smtp>
</mailSettings>[/code]
Posted by: Phil D - Monday, 18 March 2024 14:43:54
I think Iknow where its going wrong - I didnt set the email settings at the install wizard stage. Is there any way I can now add them into the regsistry if so what will the keys be called as I cant currently trace them?
Posted by: tha_watcha - Monday, 18 March 2024 20:46:32
I updated your post with the code block, in the from you need to place the actual email adress. And also set the forum email adress in the Board Settings via Admin > Settings > Board Settings
Posted by: Phil D - Tuesday, 19 March 2024 10:31:55
Thanks for this - Problem now is I don't seem to have an Admin account for those Board Settings - how do I set another admin login up?
Posted by: tha_watcha - Tuesday, 19 March 2024 11:08:15
[quote=Phil D;74092]Thanks for this - Problem now is I don't seem to have an Admin account for those Board Settings - how do I set another admin login up?[/quote]
When you have installed yaf, the install wizard ask you to create an admin/host account. With that account you can access the board settings.