Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default Email CDO.Message

    I am using CDO.Message to create an email. Currently the email sent
    says the email id of the sender however i would like it to say the
    name + email id something like this
    Email From : " Name"<name@name.com>

    If I pass this as a constant like

    Email From """Name"" <name@name.com>" it works. However when I try to
    get the values and concatenate from the tables it fails. Any idea:

    strSQL = "select top 1 * from tblEmail"
    Set rs = Server.CreateObject("ADODB.Recordset")
    Call GenerateRecordSet(strSQL,rs)
    sCSName = rs("ConfirmationEmailName")
    sCSEMail = rs("ConfirmationEmailSender")
    sCSEmailFrom = sCSName & " <" & sCSEMail & ">" (This line will fail)
    rs.Close
    Set rs = Nothing

    Set oMail = Server.CreateObject("CDO.Message")
    set oConf = CreateObject("CDO.Configuration")
    With oMail
    Set .Configuration = oConf
    ..HTMLBody = "Test"
    ..To = "test@test.com"
    ..From = sCSEMailFrom
    ..Subject = " Test"
    End With
    Set oConf = Nothing
    Set oMail = Nothing

    Raju Guest

  2. Similar Questions and Discussions

    1. How to Change the Email Subject and Default Message?
      Hi and thanks in advance for the help. I've created a PDF form that uses an email submit button but would like to use the contents of one of the...
    2. #26294 [Opn->Csd]: Message gets truncated on sending out email.
      ID: 26294 Updated by: sniper@php.net Reported By: ccetanr at nus dot edu dot sg -Status: Open +Status: ...
    3. PHP email message composing
      Hi all, I am trying to create an automatic email composing script, but I have one big problem here. The message composing method I'm using is...
    4. error message (email)
      The host 'SMTP' could not be found. Please verify that you have entered the server name correctly. Account: 'IMAP', Server: 'SMTP', Protocol: SMTP,...
    5. Open URL from email message
      Hi, When reading from email message using Net::POP3 (or other means), I need my perl program to open URLs incuded into the message. In other...
  3. #2

    Default Re: Email CDO.Message

    Raju wrote on Thu, 05 Jul 2007 16:20:21 -0700:
    > I am using CDO.Message to create an email. Currently the email sent
    > says the email id of the sender however i would like it to say the
    > name + email id something like this
    > Email From : " Name"<name@name.com>
    >
    > If I pass this as a constant like
    >
    > Email From """Name"" <name@name.com>" it works. However when I try to
    > get the values and concatenate from the tables it fails. Any idea:
    >
    > strSQL = "select top 1 * from tblEmail"
    > Set rs = Server.CreateObject("ADODB.Recordset")
    > Call GenerateRecordSet(strSQL,rs)
    > sCSName = rs("ConfirmationEmailName")
    > sCSEMail = rs("ConfirmationEmailSender")
    > sCSEmailFrom = sCSName & " <" & sCSEMail & ">" (This line will fail)
    When you say that line fails, do you mean it gives the wrong value? If it's
    causing an error then that suggests either the name or email is null.

    If it's just that you get the wrong value, it's because you have no quotes
    are the name part, so you end up with

    Name <name@name.com>

    instead of

    "Name" <name@name.com>

    Try this:

    sCSEmailFrom = """" & sCSName & """ <" & sCSEMail & ">"


    Dan


    Daniel Crichton Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139