« Previous Next »

Answered Thread: sendmail.asp

Last post 11-04-2009 4:35 PM by debugmm. 9 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (10 items)

Sort Posts:

  • 10-25-2009, 2:45 PM

    sendmail.asp

    Hi

    I'm completely new to asp script and it makes no-sense at all to me.

    I'd like to use a flash swf at http://www.pizzapal.co.uk on its contacts page.

    Sending email and comments to comments@pizzapal.co.uk.

    The FLA's action script is O.K when "check syntax" tested, so guess it must be the asp script.

    Can anyone look through the script and indentify the possible brackets which need filling and any other possible errors please?

    For a start, I do not know what to fill .From = " " with?

    <%
    sch = "http://schemas.microsoft.com/cdo/configuration/"

    Set cdoConfig = CreateObject("CDO.Configuration")

    With cdoConfig.Fields
    .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
    .Item(sch & "smtpserver") = "intmail"
    .update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = "     "
    .To = "comments@pizzapal.co.uk"
    .Subject = "13.31"
    .TextBody = "This is the Email Body"
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    %>
     

    Thank you to all of you for taking the time to read this post.

    Sabby76

  • 10-25-2009, 10:06 PM In reply to

    Re: sendmail.asp

    .from is the sender address, you can put in your email or system email address. And sometime if the mailserver won't relay the mail if it detects empty sender name.

    Anyway, is the mail sent out ? error msgs or?

     

    Cheers,
    Bernard Cheah
  • 10-26-2009, 5:00 AM In reply to

    Re: sendmail.asp

     

    Hi

    Just tried my emai in .from

    Sorry, the server is down

    Is the responce

    No messge sent out

  • 10-26-2009, 10:18 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: sendmail.asp

    sunsabbath76:
    .Item(sch & "smtpserver") = "intmail"

    That does not look like a valid smtp server name.

  • 10-26-2009, 10:47 AM In reply to

    Re: sendmail.asp

    I agree with you.

    Here is where the sendmail.asp is at now and relpying with the same error.

    <%
    sch = "http://schemas.microsoft.com/cdo/configuration"

    Set cdoConfig = CreateObject("CDO.Configuration")

    With cdoConfig.Fields
    .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
    .Item(sch & "smtpserver") = "smtp.123-reg.co.uk"
    .update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = "comments@pizzapal.co.uk"
    .To = "comments@pizzapal.co.uk"
    .Subject = "13.31"
    .TextBody = "This is the Email Body"
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    %>

     Sorry, the server is down.

     

  • 10-26-2009, 12:22 PM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: sendmail.asp

    For some reason your code can not connect to that server.

    What server is that?  Are you authorized to connect and send mail through it?

  • 10-26-2009, 2:41 PM In reply to

    Answered Re: sendmail.asp

    The sendmail.asp page is working, just...
    Here is the sendmail script.

    <%
    sch = "http://schemas.microsoft.com/cdo/configuration/"

    Set cdoConfig = CreateObject("CDO.Configuration")

    With cdoConfig.Fields
    .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
    .Item(sch & "smtpserver") = "intmail"
    .update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = "comments@pizzapal.co.uk"
    .To = "comments@pizzapal.co.uk"
    .Subject = "13.31"
    .TextBody = "comments_txt"
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    %>

    It sends this email.

    From: <comments@pizzapal.co.uk> Sent: Mon 5:54 PM
    To: <comments@pizzapal.co.uk> Priority: Normal
    Subject: 13.31 Type: Text


    In the text box it reads

    This is the Email Body

    Here is the action script from the flash sendmail page

    function sendComments() {
       var sender:LoadVars = new LoadVars();
       var responder:LoadVars = new LoadVars();
       var scriptURL:String = "http://www.pizzapal.co.uk/sendmail.asp";
       responder.onLoad = function(success){
          if (success) {
             _global.serverTime = this.timeDate;
             _root.gotoAndStop("output");
          } else {
             _root.gotoAndStop("error");
          }
       };
       sender.fromEmail = fromEmail_txt.text;
       sender.fromName = fromName_txt.text;
       sender.body = comments_txt.text;
       sender.sendAndLoad(scriptURL, responder, "POST");
       _root.gotoAndStop("wait");
    }
    this._lockroot = true;

    Can anyone help with the alignment issues.
    I will rest for an 2 hours.
    Then start again, any help is much appreciated.
    Sabby

     

     

  • 10-26-2009, 10:32 PM In reply to

    Re: sendmail.asp

    and ? what's the error msgs in event viewer?
    mail stuck where? smtp log file?

    Cheers,
    Bernard Cheah
  • 10-27-2009, 10:33 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: sendmail.asp

    sunsabbath76:
    Can anyone help with the alignment issues.

    Huh?  What alignment issues?

  • 11-04-2009, 4:35 PM In reply to

    • debugmm
    • Not Ranked
    • Joined on 10-23-2009, 8:23 PM
    • Posts 3

    Re: sendmail.asp

     Hi,

    If you mean layout of mail body and content alignment in mail body text then best way to start with <table> tag.

    Now apply styles to <td> tags like align=center.... or border / background color etc....

    and Most important don't forget to include .HTMLBody instead of .TextBody

    .TextBody = "comments_txt"

    .HTMLBody = "htmltext<table><tr><td style='align:center;'>Sample Mail</td></tr><tr><td><p>Hi, this is my paragraph.</p></td></tr></table>"

    {If you are good with div's that will be better. }

Page 1 of 1 (10 items)
Microsoft Communities