E-Mail Array - Showing Up As Blank.

Hey Again..
So I'm now trying to e-mail a log of some script actions, which include an array of data that was processed, however it seems that while I can display the data with a write-host command, I cannot e-mail it?
In this one I am trying to load a csv file, have a script update mobile numbers in ad, then e-mail some people a log of the actions it preformed. Anyway, here is the script:
## Create Variables
$errors = @()
$updates = @()
$users = import-csv "mobile_update.csv"
$date = date
## Create SMTP Objects, recipients and static data
$smtpServer = "REMOVED"
$smtp = New-Object Net.Mail.SmtpClient($smtpServer)
$emailadmin = "REMOVED"
$from = "REMOVED"
$Subject = "Mobile Numbers Updated - " + $date
$body1 = "Hello, `r`n`r`nThis automated email is to inform you that the following users mobile numbers were updated: `r`n`r`n"
$body2 = "`r`n`r`nThe following users were unable to be located: `r`n`r`n"
## Update Numbers
foreach ($user in $users)
$employee = Get-QADuser -service REMOVED -ldapfilter "(&(objectCategory=person)(objectClass=user)(employeenumber=$($user.employee_number)))"
If ($employee.samaccountname -eq $null)
$errors += $user
Else
set-qaduser -service REMOVED -identity $employee.samaccountname -mobilephone $_.mobile_number
$updates += $user
## E-mail Errors & Log of completion
$body = $body1 + $updates + $body2 + $errors
$smtp.send($from,$emailadmin,$subject,$body)
#Write-Host $updates
#Write-Host $errors
Now, I'm just rather confused why the write-host command at the bottom will output the data saved in the array, however when I try to add them to the body of an e-mail and send it, it doesn't. Instead of the data, just an empty line appears.
Not really sure what I'm missing? Any input would be fantastic!
Thanks

Hello.
try this:
$updates= $updates | out-String$errors= $errors | out-String$body = $body1 + $updates + $body2 + $errors $smtp.send($from,$emailadmin,$subject,$body)
Good luck)

Similar Messages

  • While trying to open the mail , it shows a blank screen then went to home page.

    while trying to open the mail , it shows a blank screen then went to home page.

    Hello there, Nina2800.
    It sounds like you are having issues connecting to the iTunes Store and getting a blank page.  The following Knowledge Base article offers up some great steps for verifying connectivity:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    Troubleshooting on a Mac
    If you haven't been able to connect to the iTunes Store, a software conflict or your internet service provider (ISP) may be blocking your access. 
    Update iTunes to the latest version.
    If you have a firewall, your settings may be preventing you from connecting to the iTunes Store. To configure your firewall, please refer to the "Blocked by firewall" section in this article.
    You may need to reset your keychain. Connection issues are occasionally caused by keychain issues. Click here to find out how to use Keychain First Aid to resolve any issues with your keychain.
    If you are receiving a specific error message you may want to see, the "Specific Conditions and Alert Messages" section in this article as needed.
    If the issue still persists, contact your internet service provider and confirm that the ports and servers in this article are enabled over your network.
    Additionally, this article provides some additional recomendations if the issue persists:
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/ts3297
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • ICloud mail content showing up blank in iCloud on PC, reading fine in iOS though

    I am receiving emails from a few friends and colleagues that show up fine on my iPhone. When i try to access the emails via iCloud.com on my PC. They are showing up completely blank, lost attachments etc. It seems that there are alot of people encountering this issue. Any suggestions,
    Cheers,
    G

    Hi Winston,
    Let me clarify...sorry about that. When I go to Settings --> iCloud --> Under my Account name [email protected] there is a list of "Mail, contacts, Calendars, etc" with on/off toggles, I switched Mail to off and then back on again, in hopes that this would reset itself or something. When I return to my Mail application, iCloud doesn't show as one of my Accounts, only my personal Yahoo and my work Exchange account. I cannot figure out why my iCloud mail does not show up there, even though I am logged in under iCloud and i can access it on my desktop.
    I appreciate the help.

  • Mail to show blank screen

    hi. when opening mail it seems the last mail opened remains on the screen. is there any way to open mail and show a blank screen so the last email does not show.
    thanks

    Has this question been answered elsewhere? I, too, would like to know how to open mail without the last e-mail showing.

  • HT3228 My mail icon shows how many I have, but there isn't any list on the left side.  I will read your answers on another computer.   I can send OK.

    My mail icon shows how many I have, but the screen is blank with no emails listed on the left side.  They used to be there.  I can send OK.
    Any suggestions?  I will read replies on another computer until this is resolved.

    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."

  • Discoverer report showing null instead blank

    hi,
    I am running report from discoverer and it is showing null instead blank, do I need to check some thing in pref.txt file in oracle 9i
    regards
    kumar

    hi,
    I am running report from discoverer and it is showing null instead blank, do I need to check some thing in pref.txt file in oracle 9i
    regards
    kumar

  • Trouble with Adobe Reader Touch on Lenovo Yoga Pro 2 in tablet mode. Pdf shows up as blank pages.

    I have a Lenovo Yoga Pro 2 and when I change it to tablet mode and use the Adobe Reader Touch app, my pdf shows up as a blank page. I have installed other pdfs in the past and those show up fine. However, as of three days ago, whatever pdf I install shows up as blank on my screen. Is there a solution to fix this?

    Could you please share your test file?
    You can send the file at [email protected]

  • In mail how do we stop the e-mail's showing as read when you select them without opening the full e-mail

    In mail how do we stop the e-mail's showing as read when you select them without opening the full e-mail? I want to click on a mail and read this in the preview pane only without showing it as read.

    Not possible. In order to read an email in the preview pane requires opening the message. You can mark a message that you've read as unread after reading it.

  • Mail.app shows my .mac inbox is empty.  all other tools show it is not.

    a few days ago mail started acting strangely on my .mac account. it would indicate that i had a large number of unread messages in my .mac inbox, then when i looked at the inbox in mail, it would show up as empty.
    i started to think that there must be some kind of problem, so i quit mail and checked via webmail. webmail can see all the msgs in my inbox. i quit and try mail.app again. same result (mail shows 0 messages).
    i try forcing a "synchronize" from within mail (from the mailboxes menu). there is no change. i try a "rebuild" command from the mailbox menu. there is no change.
    i try firing up entourage and it sees the mail in my inbox. i quit entourage and try mail again. no change (mail shows 0 messages).
    i suspect that there is some kind of corruption or something either in the local state on my machine or perhaps a message which has some malformed headers or something which is sitting in my inbox and causing mail.app to be unable to properly download the mailbox contents.
    i tried using webmail to go in and either delete the messages or move them aside to a separate temporary mailbox. back in mail.app, it sees the new temporary mailbox and at first indicates that it has ~40 or so unread msgs (which is true plus about 10 more read msgs), but when i actually click on the mailbox to look at it, it appears empty. i reconfirmed that webmail and entourage can both see ~50 msgs in the temp mailbox, but mail.app shows zero.
    also, in addition, the same problem still holds for my inbox. so now when i send myself a test message, mail.app temporarily indicates that i have new mail, but then when i look in my inbox, nothing appears in mail.app. if i quit and go look at my inbox with webmail or entourage, i can see the new mail as expected.
    i looked in system.log, console.log, and mail.log and didn't see any log msgs that seemed to relate to whatever problem mail was having reading the headers/contents from the server.
    so i was trying to fix the problem by clearing out my inbox using webmail, but instead it appears that i have merely replicated the cause of the problem so that it now affects two folders instead of just one.
    does anyone know of a way to definitively clear out a mailbox altogether on the server? it would be reassuring to know that there was not some hidden corrupt msg sitting in my inbox messing things up.
    any other suggestions for how to get out of this state? thanks.
      Mac OS X (10.4.5)  

    oh forgot to mention a couple other clear signs that mail.app is "confused" here:
    if i right click on a mailbox in the mailboxes window and select "get info..." (a very useful command hidden in an odd place), it shows me that right now my inbox has 3 messages and my temp mailbox has 50 messages. but when i look at either of these mailboxes normally, they show up with zero messages.
    if i send myself a test message and then tell mail.app to check for mail, the new message indicator comes on and my inbox temporarily shows up as having 3 new messages. then when i click on it, it shows up as empty and the new message indicator goes away again. if i repeat this it will say 4 new messages, etc.
    so it's acting like there's some kind of corrupt partial message at the top of my inbox that mail.app can't read and keeps choking on. i've had this happen before on other imap servers a while back. for those servers, i had normal login access, so i could go and edit or delete the offending file. in this case (apple's .mac server), i don't know how to do the equivalent.

  • TS1398 I have I-phone 4S - Since updating to IOS 6, when at home with Wi-Fi network with my I Phone connection is not responding sometimes – for example if I want to check my G-mail it shows loading but nothing happens and after few minutes it displays "C

    I have I-phone 4S - Since updating to IOS 6, when at home with Wi-Fi network with my I Phone connection is not responding sometimes – for example if I want to check my G-mail it shows loading but nothing happens and after few minutes it displays “Cannot Get Mail” – The mail server “imap.gmail.com is not responding, Verify that you have entered the correct account info in mail settings
    Other times the Wi-Fi connection works fine and it check e-mail or other within few seconds. The connection problems seems to be intermitted
    This issue never happened before with IOS 5 since I bought the new phone in Oct 2011.

    We suffered the imap.gmail.com server problem After an IoS 6 upgrade. The simple solution is to delete the problem account, shut down the iPad, start up again and reenter the account. Everything comes back normally. Good Luck everyone!

  • My mail is set up but when I touch the mail icon the screen is blank with a message saying 'no message selected' then goes straight to home page. I have rebooted, deleted and reloaded my email account but nothing is working.

    My mail is set up and it comes up with 75 messages received but when I click onto the mail icon the page is blank(White) with the message 'no message selected' and then goes to the homepage.  I have rebooted the iPad and deleted and reloaded my mail account but nothing works.

    The app is crashing for some reason - maybe an email with a very large attachment or some crappy spam email is messing things up. Quit the mail app.
    Go to the home screen first by tapping the home button. Quit/close mail by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on the mail app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close it.  Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    If mail still crashes, go to your webmail in a browser and see if you have an email in there that might be causing a problem and delete it. Then try the app again. If necessary, quit the app, restart the iPad and then try again.
    If that doesnt help, try a reset. Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • Can't send photo's in iPhoto by e-mail... I do not see an outgoing mail server show up when I enter my account info...

    I have deleted and re-entered my info at least 4 times.. I briefly see "outgoing mail server" show up and disappear and it won't send "you are not connected to the internet" error comes up... help!!!!

    Change the email client in iPhoto's General preference pane to Mail and try to email those photos again.
    OT

  • How do I make Mail stop showing notes in my inbox?

    The obvious answer is to turn off the "show notes in Inbox" option in the Mailbox Behaviours tab of Account Info, but that option is not sticking. Mail in Lion keeps re-enabling the "show notes in Inbox" option across Mail restarts. The checkbox is not disabled -- it lets me turn it off, and after a view refresh it will stop displaying notes for the session. But when I restart mail, my notes are back, cluttering up my inbox.
    I checked my com.apple.mail.plist file in ~/Library/Preferences, and the <key>MailShowNotes</key> was <true/> regardless of what I select in the Account Info dialog. I used a text editor to explicitly set the option to <false/> when Mail was not running, and now the option in the plist files stays <false/>, but Mail keeps showing notes in my inbox.
    I thought maybe it was a file permissions problem, because after a clean Lion install and Migration Assistant migration of my user account, all the files in my user directory were marked with the ACL permission "group:everyone deny delete". That setting causes all manner of grief, as Lion was unable to unlock files when I clicked Unlock after being prompted, and so Lion was unable to re-save any of my files. Other settings like desktop wallpaper also refused to stick. I used chmod at the command line to strip that setting off of all my files and then finally Lion started working properly.
    However, the com.apple.mail.plist file in ~/Library/Preferences, and its permissions, seem to get recreated with every Mail session. It does not have the "group:everyone deny delete" ACL permission set.
    Seems to be a bug in Mail, or some other source that is overriding the preference.

    I have been having similar issues with syncing notes, but do not want them to show up in my 'inbox' either.
    I have tried both methods below in Lion Mail:
    1. Try rebuilding the mailbox and see what happens (Mailbox > Rebuild). If that does nothing, consider going to System Preferences > Mail, Contacts, & Calendars and unchecking iCloud. Let it do its thing and confirm that the account isn't shown in Mail any more. Then quit Mail and turn on iCloud again. Now is it gone when you launch Mail?
    2. Mail -> Preferences -> mailbox behaiors tab and uncheck "show notes in inbox"...I cannot do this as it won't let me save the setting, comes up with a message- The “Incoming Mail Server” field cannot be empty.
    The 'Incoming Mail Server' field is not empty, although it is greyed out (p03-imap.mail.me.com) so cannot change it? Anyone else having this issue and know how to resolve it?
    S

  • How to Get Mail To Show Senders...

    It seems like ever since I upgraded to Mountain Lion, my MAIL now shows MY ADDRESS in bold in the message list, instead of showing who sent the message. I can't seem to find a way to change this...anyone?
    Thx
    Tom

    Check the box at:
    Mail > Preferences > Viewing | Display Unread Messages with bold font

  • Mail not showing in any folder...!!!

    The mail database where all the mails are stored (documents and settings/application data/thunderbird), that folder size is more than 14 GB. but no mail showing in thunderbird.

    One of the hints in [http://kb.mozillazine.org/Disappearing_mail Disappearing mail] may help.
    Otherwise you could please give more information to better understand your problem, like what you did before mails stopped showing etc.

Maybe you are looking for

  • JDBC-XI-RFC Scenario

    Hi all, Our XI Server is on linux platform and i put TRANS.mdb database file of MS Access on this machine.so for this scenario, i follow below blog. /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn

  • Javax.naming.LinkException  JNDI error Help please

    Hello All, I am trying my first bean on Weblogic 7 and can't seem to get the deployment descriptor correct. The home interface is, ObjectIDLocalHome and the full class name is com.oga.gserve.biz.oid.ObjectIDLocalHome. I am using the fully qualified c

  • Can't sync photos taken on IPhone to computer!

    If I take pictures with my IPhone and they are kept in the camera roll, shouldn't I be able to sync them to my pc?? as soon as I connect the phone to the computer it CRASHES! it will just keep rebooting untill i delete the pics from the camera roll!

  • IPhoto 11 keeps crashing when opening

    Hello My iphoto 11 keeps crashing when I open. I have over a 10GB library and have tried to repair all options when doing the option/command and have upgraded the latest fix for the program. This all started with icloud and when moving photos to phot

  • Event Structure Help

    So I wrote this program not knowing how event structures worked ahead of time, and I did pretty well except for 1 problem.  I set the event to continue on a value change of the "Continue..." button on the bottom right of the screen (block diagram is