YAFLogo

Phil D
  • Phil D
  • 70.6% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
3 months ago
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

 

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
3 months ago
Yaf 3.2.2 already includes a sample web.config. You can see it here online... https://github.com/YAFNET/YAFNET/blob/netfx/yafsrc/YetAnotherForum.NET/recommended.web.config 

In the mailSettings section you configure your email

<mailSettings>
        <smtp deliveryMethod="Network" from="forumadmin@yourdomain.com">
            <network host="localhost" port="587" password="password" userName="username" enableSsl="true" />
        </smtp>
    </mailSettings>

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

Phil D
  • Phil D
  • 70.6% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
3 months ago
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

                                   }

                           };

     verifyEmail.SendEmail(new MailAddress(email, newUsername ?? user.UserName), subject);

 }

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
3 months ago
You need to wrap the web.config xml code in a bbcode code block in order to post it....

[ code]content[/code]

Phil D
  • Phil D
  • 70.6% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
3 months ago
Do you have an example of that please?
Phil D
  • Phil D
  • 70.6% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
3 months ago
Finally clocked what you meant!

   

     

   

 

Phil D
  • Phil D
  • 70.6% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
3 months ago
The blocks dont work -  heres the settings

<mailSettings>
        <smtp deliveryMethod="Network" from="forumadmin@yourdomain.com">
            <network host="smtp.sendgrid.net" port="587" password="SG.XXXX" userName="apikey" enableSsl="true" />
        </smtp>
    </mailSettings>
Phil D
  • Phil D
  • 70.6% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
3 months ago
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? 
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
3 months ago
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
Phil D
  • Phil D
  • 70.6% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
3 months ago
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?
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
3 months ago

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?

Originally Posted by: Phil D 

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.