locked
Emailing with 2 way auth RRS feed

  • Question

  • User1510859543 posted

    Is there a way in asp.net to handle sending an email when user has 2-way authentication where I think their cell phone is sent a code?  We are using code similar to below when we send out an email from our asp.net application.

                Dim strServer As String = MessageClass.GetSmtpServer()
                strEpw = AuthClass.GetEmailpw(strEmployeeCode)
    
                '(4) Create the SmtpClient object
                Dim smtp As New Mail.SmtpClient(strServer, 587)
                smtp.DeliveryMethod = SmtpDeliveryMethod.Network
                strAddress = Request.Cookies("myemail").Value
    
                'below line must be before the network credentials
                smtp.UseDefaultCredentials = False
                smtp.Credentials = New NetworkCredential(strAddress, strEpw)
                smtp.EnableSsl = True
    
                '(5) Send the MailMessage (will use above settings)
                smtp.Send(mm)
    

    Friday, October 18, 2019 8:23 PM

Answers

  • User475983607 posted

    No. I was wondering if there is a way to handle sending an email from a website when the sending email account has extra authentication, like a code sent via sms.

    You are looking for an SMS provider?  

    https://www.twilio.com/docs/quickstart

    Can you explain the problem you are trying to solve?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 18, 2019 11:03 PM

All replies

  • User475983607 posted

    So your question is detecting that a browser running on a cell phone accessed your site from an email?  Try reading the user-agent. 

    Can you explain why it matters if a mobile device accesses your site or accesses email to get a auth token?

    Friday, October 18, 2019 8:49 PM
  • User1510859543 posted

    No. I was wondering if there is a way to handle sending an email from a website when the sending email account has extra authentication, like a code sent via sms.

    Friday, October 18, 2019 10:19 PM
  • User475983607 posted

    No. I was wondering if there is a way to handle sending an email from a website when the sending email account has extra authentication, like a code sent via sms.

    You are looking for an SMS provider?  

    https://www.twilio.com/docs/quickstart

    Can you explain the problem you are trying to solve?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 18, 2019 11:03 PM
  • User1510859543 posted

    Customer found another solution so I am dropping this issue for now.

    Saturday, October 19, 2019 4:11 PM