5 Replies Latest reply on Oct 7, 2014 7:07 AM by alinicjones

    Script Not working when I'm trying to send email....

    alinicjones

      I created a script to attach a PDF of their grade report to them from a button on a layout. The script works fine when I put in my email address to test it out but when I have it pull and email from the record it doesn’t work.

      I have a field where open text field called UniqueName which is the first part of their email address. I have tried to enter in the email “To:” part as “UniqueName & “@umich.edu” and that doesn’t work either. So I tired making an email calculation field and based it off that. For instance, field named Email (calculation = UniqueName & “@umich.edu” ). Then I used that field in the email “To:” section and it didn’t work either.

       

      Here is my script:

       

      Set Error Capture [On]

      Freeze Window

      Go to Related Record [ Show only related records; From table: “student_GRADE”; Using layout: “Print | Student Grade Report” (Grade) ; New Window ]

      If [ Get ( LastError ) = 0 ]

      Set Variable [ $PATH; Value: Get (TemporaryPath ) & grade_STUDENT::St_LastName & “.pdf” ]

      Save Records as PDF [ Restore; No dialog; “$PATH”; Records being browsed ]

      Send Mail [ Send via E-mail Client; To: Student::Email ; “$PATH” ]

      Set Field [ Student::Sent Grades On; Get ( CurrentTimeStamp ) ]

      Close Window [ Current Window ]

      End If

       

      I would appreciate any help or suggestions.

       

      Thank you in advance!