+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: email

  1. #1
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    email

    Hi,

    I am displaying all the email address in a textarea and i have a small problem

    the code is like this

    <%

    do while not rs.eof

    names=names & rs("Email") & ","

    rs.movenext
    loop
    %>

    <textarea name="email1" id="email1"><%=names%></textarea>



    there is a comma after the last email

    can someone tell me how to get rid of that comma


    todd

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Try:
    Code:
    <%=Left(names, Len(names) -1) %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #3
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    Hi,

    Thanks Jason that worked out



    Now the user will hit submit and I will send all those students an email

    The next page is where i have my asp code


    Here is my email

    email1=Trim(Request.form("email1"))

    I need to seperate all those emails from the textarea that i get in email1 variable and then do a loop

    Code:
    For 1=0 to LBound(email1)
    
    Subject1=subj1
    Body=body1
    Set Jmail=Server.CreateObject("JMAIL.SMTPMAIL")
    JMail.ServerAddress="XXX.XX.XX.XXX"
    Jmail.Sender="myemail@yahoo.com"
    Jmail.Subject=Subject
    Jmail.Body=Body
    Jmail.Execute
    Set Jmail=Nothing
    
    
    Next
    
    But it doesnt work out it gives me an error on ubound

    any idea

    todd

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Do this:
    Code:
    Dim emails
    emails = Split(email1, ",")
    For Each address In emails
        ' your code here
    Next
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  5. #5
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    its giving an error saying undefined variable address

  6. #6
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    I just ran the same exact code and it works fine for me.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  7. #7
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    Jason

    Wow it worked for u and not for me. Is it asp syntax or asp.net

    I am confused

    Todd

  8. #8
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Post your updated code. Undeclared variable isn't a syntax error
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  9. #9
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Would Option Explicit make it throw an error on address if you didn't have Dim address first of all?

  10. #10
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Quote Originally Posted by richyrich View Post
    Would Option Explicit make it throw an error on address if you didn't have Dim address first of all?
    Yes, that's correct. In this case, you would have to add the following before the For Each loop:
    Code:
    Dim address
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Email Class
    By jmurrayhead in forum .NET Code Samples
    Replies: 3
    Last Post: July 8th, 2011, 08:09 AM
  2. Would you 'style' a CDONTS email?
    By Centurion in forum ASP Development
    Replies: 1
    Last Post: April 6th, 2010, 03:24 PM
  3. Using file as email body
    By richyrich in forum .NET Development
    Replies: 5
    Last Post: February 8th, 2010, 05:53 PM
  4. Excel and Email
    By Chrissy in forum ASP Development
    Replies: 10
    Last Post: February 16th, 2009, 09:11 PM
  5. help with email validation
    By Rebelle in forum JavaScript Programming
    Replies: 13
    Last Post: August 21st, 2008, 11:57 AM

Bookmarks

Posting Permissions

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

SEO by vBSEO