none
Email sending a duplicate RRS feed

  • Question

  • Hello

    My SMTP code sents an email and a duplicate to the user at exactly the same time (so he receives two emails). To try to eliminate this duplicity, I have placed a breakpoint here in my vb.net SMTP code:

    Smtpserver.Send(myMessage)

    and then pressed F5. That loaded up my Web page (www.dimadayoub.net/forgot.aspx) which I then closed and then, from the menubar, selected 'Step into'. I am not quite sure what I am looking for (or where to look for it), but there is a list in the Locals pane, nothing in the Watch pane and, in Call stack, I see Global code [forgot.aspx] Line 104 and Language: Script. In the Command pane, I see an inexplicable lonely a right-pointing arrow and nothing else, nothing in the Immediate window, and in Output, under JavaScript Language Service, I get this:

    12:07:42.5488: Referenced file '~/Scripts/_references.js' not found.

    And yet, in the Scripts folder in Solution Explorer (VS 2013 Express), I can see the _references.js.

    Any advice would be welcome.

    Thank you.



    Tuesday, March 7, 2017 12:32 AM

All replies

  • This is Visual Studio Languages -=> .NET Framework  -=>  Visual Basic
    Tuesday, March 7, 2017 1:33 AM
  • Hello

    Thanks for your reply.

    You mean it's not Visual Studio VB.NET?

    Thanks

    Tuesday, March 7, 2017 1:38 AM
  • Hello,

    _reference.js is for when you are coding only, if you place an existing .js file in it then Visual Studio attempts to supply Intellisense for the objects, methods and properties.

    The contents would look like this. Again, it has nothing to do with your VB.NET code.

    /// <autosync enabled="false" />
    /// <reference path="../js/adal.js" />
    /// <reference path="../js/app.js" />
    /// <reference path="../js/authentication.js" />
    /// <reference path="../js/mainGlobal.js" />
    /// <reference path="../js/mainMenu.js" />
    /// <reference path="../js/revenueCommon.js" />
    /// <reference path="../js/validator.js" />
    /// <reference path="jquery.mockjax.js" />
    /// <reference path="jquery-1.10.2.js" />
    /// <reference path="jquery-ui.js" />
    /// <reference path="kendo.all.js" />
    /// <reference path="kendo.dataviz.js" />
    /// <reference path="kendo.mobile.js" />
    /// <reference path="kendo.web.js" />
    /// <reference path="mockAjaxCommon.js" />
    /// <reference path="mockjax-demo-data.js" />
    /// <reference path="mockjax-service.js" />
    /// <reference path="mockjax-test-data.js" />
    /// <reference path="qunit-1.18.0.js" />
    /// <reference path="qunit-composite.js" />
    /// <reference path="sinon-1.17.2.js" />
    /// <reference path="sinon-qunit-1.0.0.js" />
    

    In regards to a duplicate email being sent, if you have one place to send emails perhaps the event is being triggered by something you are not currently aware of. So if you had code similar to this in a function or sub something is calling it twice.

     'create the mail message
    Dim mail As New MailMessage()
    
    'set the addresses
    mail.From = New MailAddress("me@mycompany.com")
    mail.To.Add("you@yourcompany.com")
    
    'set the content
    mail.Subject = "This is an email"
    mail.Body = "this is a sample body"
    
    'send the message
    Dim smtp As New SmtpClient("127.0.0.1")
    smtp.Send(mail)

    If you are using ASP.NET then consider asking here. You might consider the issue could be from a IIFE or perhaps .On in jQuery is being triggered multiple times to invoke the VB.NET code.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Tuesday, March 7, 2017 1:43 AM
    Moderator
  • Hello

    Thanks for your reply.

    You mean it's not Visual Studio VB.NET?

    Thanks

    The _reference.js file is Visual Studio but not the duplicate email piece.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Tuesday, March 7, 2017 1:44 AM
    Moderator
  • Hello Karen

    Thanks for your reply.

    My _reference.js file looks like this:

    /// <autosync enabled="true" />
    /// <reference path="../js/image_fade.js" />
    /// <reference path="../js/jquery-2.1.0.min.js" />
    /// <reference path="../js/jquery-2.1.1.min.js" />
    /// <reference path="../js/jquery.easing-sooper.js" />
    /// <reference path="../js/jquery.kwicks-1.5.1.js" />
    /// <reference path="../js/jquery.sooperfish.js" />
    /// <reference path="../js/modernizr-latest.js" />
    /// <reference path="bootstrap.js" />
    /// <reference path="jquery-2.1.3.js" />
    /// <reference path="jquery-ui-1.8.24.js" />
    /// <reference path="modernizr-2.6.2.js" />
    /// <reference path="respond.js" />
    /// <reference path="../js/_references.js" />

    Yes, I do have something similar to the SMTP sample code you have posted but can't see anything responsible for a duplicate email.

    I will post on the asp.net forum - thank you!

    Tuesday, March 7, 2017 1:51 AM