+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: email

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

    Here is the code

    Code:
    
    <%
    
    Set rs= Server.CreateObject("ADODB.Recordset")
    str="select * from students"
    rs.Open str, Conn
    
    
    If rsproducts.eof then
    
    else
                    Do while not rs.eof
                                    getnames=getnames & rs("Email") & ","
                                    rs.movenext
                                    Loop
                          
    
    %>
    <textarea cols="80" rows="12" name="email1" id="email1"><%=Left(getnames, Len(getnames) -1)%></textarea>
    <input type="submit" value="Sent">
    <%
    End If
    rs.close
    Set rs=Nothing
    %>
    
    Code:
    <%
    email=Trim(Request.Form("email1"))
    subject=Trim(Request.Form("emailsubject"))
    body=Trim(Request.Form("emailbody"))
    
    
    email=Split(email, ",")
    
    For Each address In email
    Subject1=subject
    Body1 = Body1 & body
    Set JMail1 = Server.CreateObject("JMail.SMTPMail")
    JMail1.ServerAddress = "XX.XXX.XX.XXX"
    JMail1.ContentType = "text/html"
    
    JMail1.Sender = "myemail@yahoo.com"
    JMail1.AddRecipient email
    JMail1.Subject = Subject1
    JMail1.HTMLBody =Body1
    JMail1.Priority = 1
    JMail1.Execute
    Set JMail1 = Nothing
    
    Next
    %>
    

  2. #12
    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

    As stated above, add: Dim address above your For Each loop:
    Code:
    Dim address
    For Each address In email
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


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

    Json,

    Sorry my mistake

    now new error type mismatch AddRecipient

    Todd

  4. #14
    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

    Quote Originally Posted by todd2006 View Post
    Json,

    Sorry my mistake

    now new error type mismatch AddRecipient

    Todd
    AddRecipient method is expecting an email address. You have
    Code:
    JMail1.AddRecipient email
    
    I don't see the variable email defined in your code. Try:-
    Code:
    JMail1.AddRecipient address
    

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

    Thanks both Jason and Richyrich

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

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