Mailx sending attachments to personal email, but not SharePoint?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mailx sending attachments to personal email, but not SharePoint?
# 1  
Old 03-04-2015
Mailx sending attachments to personal email, but not SharePoint?

Hello! I am writing a KornShell script that (in addition to other things) sends a file from a Unix directory to a SharePoint directory. However when executing the script there is no sign of the file on the SharePoint.

I have tested the script using my personal email as the destination and the files are sent correctly (as attachments). I have also tried sending an email with attachments to the SharePoint through Outlook and the files are correctly uploaded. There is some sort of disconnect though when attempting to send files to the SharePoint via the script.

My code:
Code:
# Change Internal Field Seperator (IFS) to account for spaces in filename
IFSSAVE=$IFS
IFS='
'

# Mail most recent outage report to share point
for file in `ls -1t $outageFileName | head -n 1` 
do 
    fullPath=$filePath$file
    uuencode $fullPath ${fullPath##*/} | mailx -m -s "Outage Report" $spEmail
done

# Mail most recent job report to share point
for file in `ls -1t $jobFileName | head -n 1` 
do 
    fullPath=$filePath$file
    uuencode $fullPath ${fullPath##*/} | mailx -m -s "Job Report" $spEmail
done

# Reset IFS
IFS=$IFSSAVE

Q: Why are the files not being uploaded to the SharePoint and how can I alter the script to properly upload the files?

Thanks,
Matt
# 2  
Old 03-04-2015
When you say 'Share Point', what are you actually hoping to have happen?
mailx is a tool to email (can have an attachment) something to a user account.
perhaps you need to think about using a tool like ftp to transfer the file to a particular location on a specific server.
# 3  
Old 03-04-2015
Quote:
Originally Posted by joeyg
When you say 'Share Point', what are you actually hoping to have happen?
mailx is a tool to email (can have an attachment) something to a user account.
perhaps you need to think about using a tool like ftp to transfer the file to a particular location on a specific server.
There is a destination directory within the SharePoint that is setup to accept emails with attachments. When an email is received, the attachments are uploaded into the directory. This has been tested by personal email. However, when trying to send from a script, the files are not uploaded.

Note: Unfortunately, I do not have access to the SharePoint and have very little experience with SharePoint in general.
# 4  
Old 03-09-2015
After some troubleshooting I was able to access the mail.log.

I receive the following errors in the stat field:

Code:
stat=Transient parse error -- message queued for future delivery

When looking at the mail queue, each unsent email has a the following note:

Code:
(host map: lookup (domain): deferred)

Is this a an issue connecting with the domain?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending an email with a body and attachments using uuencode

Hi, Im having a bit of an issue with using the uuencode command and sending out an email. My aim is to send an email out which has a body and also have attachments. Currently I can either get one or the other and not both on the same email. uuencode... (4 Replies)
Discussion started by: 02JayJay02
4 Replies

2. Shell Programming and Scripting

Sending Multiple Attachments using MAILX

I have created a shell scripts and wanted to email users multiple attachments using mailx. I noticed that when I do a man on mailx I see and -a option for attachments. When I run a: mailx -s "test attachments" -a include_file -a exclude_file testuser@mydomain.com (Interrupt -- one more to... (1 Reply)
Discussion started by: metallica1973
1 Replies

3. Shell Programming and Scripting

Sending HTML Email through mailx

Hi, I am trying to send html email using mailx like follow on sh shell (Bourne) on HP-UX: mailx -s "Test HTML output in outlook MIME-Version: 1.0 Content-Type: text/html" receiver@host.com < file.txt Content of file.txt are as follows: <html> <h2>An important link to look at!</h2>... (3 Replies)
Discussion started by: manubatham20
3 Replies

4. HP-UX

Sending Unix files as attachments in an email

Hi, I am executing the following command in order to send a file as an attachment: mailx -s "Subject" emailID@xyz.com < Testfile.txt Instead of attaching the file Testfile.txt, it is writing the contents of the file in the email message body. Please advise on how I can send the file as an... (7 Replies)
Discussion started by: sangharsh
7 Replies

5. Shell Programming and Scripting

Shell script for sending automatic email to personal mail id

hi guys, I need a shell script to send mail automatically to my personal mail id like xxxx@hotmail.com but while experimenting with "mail" command I faced following problems. cat text1.txt | mail -s 'test mail' xxxx@hotmail.com command successfully executed but while checking for... (4 Replies)
Discussion started by: rrd1986
4 Replies

6. UNIX for Dummies Questions & Answers

Using mailx to save attachments

Hi, I have a requirement to save a mail attachment sent from Windows to a Solaris 9 server. I'm using mailx on the server and have seen a few examples of how to attach a file for sending but none for how to save the attachment when receiving. I can see the encoded text when I look at... (2 Replies)
Discussion started by: Jublio
2 Replies

7. UNIX for Dummies Questions & Answers

Sending email attachments

Hello, I've search the forum, but I cannot find an answer to my specific question. I'm trying to send some files to my professor. Upon his request, I used the following: tar -cvf vh.tar vh_part1.c vh_part2.c vh_part3.c vh_part4.c vh_sample_run15.txt uuencode vh.tar vh.tar > proj1 mail... (2 Replies)
Discussion started by: venush
2 Replies

8. Shell Programming and Scripting

Sending email with text & attachment using mailx

I spent some time working this out, with a little help from various forums, and thought the community would like to know : Here is how you can send an email from a single Unix command line : /usr/bin/echo "Email text\nNew line\nAnother new line" >x | uuencode sourcefile.txt sourcefile.txt |... (3 Replies)
Discussion started by: haryadoon
3 Replies

9. Shell Programming and Scripting

Sending attachments using email through shell script

Hi all, I have written a shell script which sends emails with attachments to our clients. All our attachments are simple flat files (.txt format). The script is working fine and sending the attachments to the mail-ids except that, when i am sending the attachments to non-outlook users (Like... (6 Replies)
Discussion started by: symhonian
6 Replies

10. UNIX for Dummies Questions & Answers

sending email from mailx

hi can i know how to use mailx to send email to my lotus email account? i wan to send a file in a directory as an attachment and then email to lotus. can show me the command line to do it? thanks a lot (1 Reply)
Discussion started by: legato
1 Replies
Login or Register to Ask a Question