Send Email with attachment

271 views
Skip to first unread message

Linux_01

unread,
Apr 2, 2021, 8:02:30 AM4/2/21
to GAM for Google Workspace
Hello Team,

I am trying to send email with attachment using below gam command with no success:

gam sendemail to $EmailID from "Username<us...@domain.com>" subject "Test Mail" file $scripts/EmailBody.txt attach $pdf

Gam command not recognising the PDF file to attached, file does not exists error.

Where am I going wrong?

Thank you.

Regards,
Linux_01

Ross Scroggs

unread,
Apr 2, 2021, 8:50:20 AM4/2/21
to google-ap...@googlegroups.com
Does $pdf represent a full path to a file? If not, the file must be in your current working directory.

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/e12d9a85-376f-46e2-bfa6-7340609e356an%40googlegroups.com.

Jyoti Madur

unread,
Apr 2, 2021, 9:06:00 AM4/2/21
to google-ap...@googlegroups.com
Yes $pdf represents the absolute path of the pdf file to be attached to the email but the gam is not recognising it.





--
Regards,
Jyoti Madur

Ross Scroggs

unread,
Apr 2, 2021, 9:12:11 AM4/2/21
to google-ap...@googlegroups.com
Please show the full command and error message; you can change the email address, but leave everything else alone.

Message has been deleted

Linux_01

unread,
Apr 2, 2021, 12:09:27 PM4/2/21
to GAM for Google Workspace
Command: /home/admin/bin/gamadv-xtd3/gam sendemail to us...@domain.com from " XYZ<x...@domain.com>" subject "M<<< S cards" file /home/admin/Scripts/abcxt attach >>>/home/admin/Scripts/d1.pdf

, Does not existme/admin/Scripts/d1.pdf

Ross Scroggs

unread,
Apr 2, 2021, 12:31:24 PM4/2/21
to google-ap...@googlegroups.com

This can't be the error message:

Command: /home/admin/bin/gamadv-xtd3/gam sendemail to us...@domain.com from " XYZ<x...@domain.com>" subject "M<<< S cards" file /home/admin/Scripts/abcxt attach >>>/home/admin/Scripts/d1.pdf

, Does not existme/admin/Scripts/d1.pdf


The error message should look like this:


$ gam sendemail to ross.s...@gmail.com message Test subject Test attach /Users/admin/foo.txt

Command: /Users/admin/Documents/GoogleApps/GAM3/gam.py sendemail to ross.s...@gmail.com message Test subject Test attach >>>/Users/admin/foo.txt<<< 


ERROR: File: /Users/admin/foo.txt, Does not exist


Send me a direct email.


Ross




--
Reply all
Reply to author
Forward
0 new messages