Mail recipients in a variable

Results 1 to 3 of 3

Thread: Mail recipients in a variable

  1. #1
    Join Date
    Dec 1969

    Default Mail recipients in a variable

    Here&#039;s a block of code that I use to send mail from a webpage. What I want to do is put the recipent list in a variable in an include file, so that the website is more transportable and can be used by some of our other sites by just changing the contents of the include file and the code (variable names) can remain the same. Before I did so, I wanted to make sure this is something that can be done. I didn&#039;t know if there was a problem putting email addresses into a variable and if the syntax would be handled differently. Thanks. <BR>&#060;%<BR>Dim SendSubj<BR>Dim StrTo, StrSubj<BR>Dim objCDOMail<BR>StrTo = ",,,,"<BR>StrSubj = Request("Skill") & ", " & Request("Name")&"\"&Request("ID") & " " &str1Date& " " &str2Date& " " &str3Date& " " &str4Date& " " &str5Date<BR>SendSubj = "Confirmation number: " & rsIdentity.fields(0) & vbCrLf<BR>SendSubj = SendSubj & "This email was sent " & Request.Form("SubmitDate") & " from IP Address " & Request.ServerVariables("Remote_ADDR") & vbCrLf & vbCrLf<BR>SendSubj = SendSubj & "Their comments are:" & vbCRLF<BR>SendSubj = SendSubj & Request.Form("Comments") & vbCRLF<BR>&#039; Prepare to send email<BR>Set objCDOMail = Server.CreateObject("CDONTS.NewMail")<BR>objCDOMai l.From = ""<BR>objCDOMail.To = StrTo<BR>objCDOMail.Subject = StrSubj<BR>objCDOMail.Body = SendSubj<BR>objCDOMail.Importance = 2<BR>objCDOMail.BodyFormat = 0<BR>objCDOMail.Send<BR>Set objCDOMail = Nothing<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Mail recipients in a variable

    I don&#039;t see how it would be handled differently...<BR><BR>If you can do this:<BR>==== START<BR>obj.SendTo = ",,"<BR>==== END<BR>Then logically you can do this:<BR>==== START<BR>Dim SendTo<BR>SendTo = ",,"<BR>obj.SendTo = SendTo<BR>==== END<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default Nope

    Just plug away as planned, syntax wont change, although you will have to modify the reciepents to receive a variable instead of a string, and just make sure you put the string into the variable.<BR>Like so...<BR><BR>variable = ""<BR><BR>addReceipient variable

Posting Permissions

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