Send email with CSS not working

I am trying to send email using the below function. On the email it comes without CSS.Can anybody please help meFunction sendEmail
Param([string] $Body)
$smtpServer = "mailhost.lsg"
$smtpFrom = "[email protected]"
$smtpTo = "[email protected]"
$messageSubject = "Monitoring Domain Replication & Health issues"
$message = New-Object System.Net.Mail.MailMessage $smtpfrom, $smtpto
$message.Subject = $messageSubject
$message.IsBodyHTML = $true
$message.Body = (Get-Content c:\temp\html.html | Out-String)
$smtp = New-Object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($message)
} # End function SendEmail
$workfile = repadmin.exe /showrepl * /csv
$results = ConvertFrom-Csv -InputObject $workfile
$results = $results | select "Source DSA", "Naming Context", "Destination DSA" ,"Number of Failures", "Last Failure Time", "Last Success Time","Last Failure Status" | ConvertTo-Html -CssUri c:\temp\style.css
$results | out-file "c:\temp\asif.html"
$style='<style type="text/css">
#Header{font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;width:100%;border-collapse:collapse;}
#Header td, #Header th {font-size:14px;border:1px solid #98bf21;padding:3px 7px 2px 7px;}
#Header th {font-size:14px;text-align:left;padding-top:5px;padding-bottom:4px;background-color:#A7C942;color:#fff;}
#Header tr.alt td {color:#000;background-color:#EAF2D3;}
</Style>'
$body= $style + $results
$body | Out-File c:\temp\html.html
sendEmail $body

Hi asif,
Please try this:
$body= $style + $results
$body | Out-File c:\temp\html.html
$body1= (Get-Content c:\temp\html.html) | out-string
sendEmail $body1
If I have any misunderstanding, please let me know.
Best Regards,
Anna

Similar Messages

  • Sending email with attachments not working on Lumi...

    It is not possible to attach a file to an email, either via WiFi or my 4G connection.  I have two different Office365 email accounts (work and private) that work perfectly when sending/receiving emails with/without attachments.  However when I try and share a photo (from any folder in Photos) I can select a photo, choose Share-->Email account, but when it brings up the email message screen there is nothing attached.  The same thing happens if I create an ordinary email and try to attach any file, it won't attach and the email sends OK without the attachment.
    It is not an issue with the email accounts as I can send/receive attachments OK from my laptop and iPad.  It is only when I try and send from my 1520.
    This has got me baffled!

    try to delete the account and re-add the account.
    then, try to take a picture and immediately go to that image by tapping it on the screen and sharing as you stated.
    if that doesn't work, then I wonder if the device is corrupted and the images are not "really there"
    can you see the images on your skydrive account?
    have you tried to do a soft reset?
    Soft Reset-
    Hold Vol- & Pwr until the device shuts down
    When the device vibrates and starts to reboot, release ONLY Pwr button, still holding the Vol-
    When you see the (!) on your screen, then release the Vol- button and wait until the device boots.
    Your device is now soft reset

  • Z10 can't send email with ActiveSync from work Outlook webmail

    First off, love my Z10. It was able to connect to my work's Outlook webmail with no problem. I am able to get calendar and work emails.
    HOWEVER, I can't seem to be able to send email through my work account. When sending an email, I keep getting this red wrong way icon with the message:
    Message Status: Acknowledgement for send was not received from Server.
    What's wrong?
    I checked through my Outlook web account and it shows my phone within Mobile Phone Details:
    Access state: Access Granted
    Policy applied: Default - Applied in full
    ActiveSync version: 14.0
    Is there something I need to ask my IT staff for?
    Thanks.

    DueNorth wrote:
    First off, love my Z10. It was able to connect to my work's Outlook webmail with no problem. I am able to get calendar and work emails.
    HOWEVER, I can't seem to be able to send email through my work account. When sending an email, I keep getting this red wrong way icon with the message:
    Message Status: Acknowledgement for send was not received from Server.
    What's wrong?
    I checked through my Outlook web account and it shows my phone within Mobile Phone Details:
    Access state: Access Granted
    Policy applied: Default - Applied in full
    ActiveSync version: 14.0
    Is there something I need to ask my IT staff for?
    Thanks.
    It appears as if your email is running on Exchange 2010, and if so then you can troubleshoot this issue yourself to see if your phone is even talking to your ActiveSync server when it is trying to send the emails. If something doesn't jump out at you during this process, this information should help your IT folks in troubleshooting the effort.
    http://blogs.msdn.com/b/mstehle/archive/2013/04/29/howto-visual-guide-to-turn-on-exchange-activesync...
    You can also test the full functionality of ActiveSync on your account by using Microsoft's following testing tool, which should point out any major issues:
    https://www.testexchangeconnectivity.com/
    In regards to your question about what to ask your IT staff for, as an Exchange engineer myself I don't think there is anything on the server side that would let you connect and download email but not send it. So I would want to see the logs mentioned above to see what was going on with the device to server connectivity, in conjunction to the error message you already grabbed.
    There are some random "fixes" on the Internet such as this one which would be a server side configuration change, but again the more information you can supply your IT folks the better:
    http://forums.crackberry.com/blackberry-10-os-f269/bb10-exchange-activesync-issue-775934/

  • Send Email SMTP Authentication not working

    Hello,
    I have the following Problem, I want to send E-mail via the Send Email Activity to Mailing Lists/Group. But the authentication doesn't work, the Exchange says I dont have the needed permissions. I have filled all the Data into Advanced -> SMTP authentication.
    The strange thing it works with the same Account if it is used inside the Service Manager.
    We use Exchange 2010 & Orchestrator 2012 SP1.
    Regards,
    Jan

    Hi,
    perhaps the Runbook Service account or IP address have no rights as relay at the Exchange-SMTP (?).
    I suggest to test at the Runbook Server(s) via telnet:
    http://support.microsoft.com/kb/153119
    Regards,
    Stefan
    www.sc-orchestrator.eu ,
    Blog sc-orchestrator.eu

  • Sending Email Tutorial Does Not Work

    Has anyone been able to successfully complete the "Sending Email From a Web Application" tutorial?
    I am able to Build and Deploy, but receive a "Class Not Found" error on deployment.
    Win2K sp3, 1Gig Ram 3 Gigs Free Disk
    I am using my own email account for both To: and From: on our Exchange email server.
    Thanks in advance.
    Clay

    Make sure everything you need is in your classpath.
    Hope this helps,
    - D.t.O

  • Send Email to group not working

    Using MOSS 2007 SP1, I am creating a SPD workflow and one of the actions is a Email action.
    If I have it send the e-mail to my email address, it works.
    I created an Active Directory security group and put myself in the group.
    If I have it send the email to the Active Directory group, which appears in the lookup list for the To: field, I do not get the e-mail.  There are no errors in the logs.
    I created a Sharepoint Group and put myself in the group.
    if I have it send the email to the Sharepoint Group, which appears in the lookup list for the To: field, I do not get the e-mail.  There are no errors in the logs.
    Why wouldn't the e-mails to the groups work?  Both of those methods should work, shouldn't they?

     
    Hello,
               If you are integrating your MOSS with Exchange server 2007 to send out-going email then please try the following steps to fix your problem:
    1.       Go to Exchange Management Console -> Recipient Configuration -> Distribution group.
    2.       Right-click on the problem group and choose properties.
    3.       On the Mail Flow Settings tab, double click on Message Delivery Restrictions.
    4.       Uncheck the check box "Require that all senders are authenticated".
             Have a try and see the effect.
             Hope it can help you,
             Jerry
    Xing-Bing Yu

  • EMAIL WITH REPORT NOT WORKING

    I have the Display version of this report working on line.
    Now, I am trying to email the report to the individual requesting
    the report. It is getting an error message on the second
    <table> saying it contains invalid data. I am working with a
    client on Coldfusion 5, so we are NOT using current software.
    Can a report even be emailed?
    If yes, how do I approach this. I could not find any
    previously written problems on this, so it may not even be
    possible. The report is much larger that below, but below includes
    the error and did not see any reason to attach the entire report.
    Thanks for any guidance.
    <CFMAIL TO="#Session.SecurityEmailAddress#"
    FROM="[email protected]"
    SUBJECT="Request Chronology Report"
    SERVER="10.130.1.76"
    PORT="25"
    TIMEOUT="30">
    <table>
    <tr>
    <td width="50">
    </td>
    <td>
    <img src="images/TITLE-AgencyReporting-400-40.gif"
    width=500 height=45>
    </td>
    </tr>
    </table>
    <table width="600", bgcolor="#ffffff", cellpadding="0",
    cellspacing="0", border="3">
    <tr>
    <td rowspan="3">
    <center><img src="images/911logo-1000-1000.gif"
    width=120 height=120></center>
    </td>
    <td colspan="3" height="30">
    <cfoutput><center><h2>#Session.InquiryAgencyName#</h2></center></cfoutput>
    </td>
    </tr>
    <tr>
    <td colspan="3" height="30">
    <center><img
    src="images/title-ChronologyReport-400-40.gif" width=400
    height=35></center>
    </td>
    </tr>
    <tr>
    <td width="*" height="60">
    <cfoutput><center><h2>Event Number:
    #Session.ChronologyNumber#</h2></center></cfoutput>
    </td>
    </tr>
    </table>
    <cfoutput query="GetChronologyList">
    <cfset ExtractHdrYear = "#Left(getchronologylist.cdts,
    4)#">
    <cfset ExtractHdrMonth = "#Mid(getchronologyList.cdts, 5,
    2)#">
    <cfset ExtractHdrDay = "#Mid(getchronologyList.cdts, 7,
    2)#">
    <cfset HdrPrintDate =
    "#ExtractHdrMonth#/#ExtractHdrDay#/#ExtractHdrYear#">
    </cfoutput>
    </CFMAIL>

    Thats what I did for out mail reports its not super pretty
    but.
    The action on the form point to a page containing below code
    THis page has the CFMAIl and the SQL INSERT on it.
    <cfmail to="[email protected]"
    from="[email protected]"
    subject="New Event Added, #FORM.EventName#"
    server="pop3.preventpollution.org"
    cc="#MailTo#"
    >
    Event Name: #FORM.EventName#
    StartDate: #FORM.StartDate#
    End Date: #FORM.EndDate#
    Description:
    #FORM.EventDescription#
    </cfmail>
    <cflocation url="mailer.cfm">
    </cfif>
    Hope that Helps...
    Tom

  • Outlook 2013 sending email using template not working properly...

    I've created several email templates by doing the following:
    open new message
    add some tekst in the body
    save as > oft file
    Now when I open such oft file I add some modifications in the body text and send the message. However, the send item does not contain the modifications I just made, only the text that was included in the template.
    We're using Outlook 2013 SP1 (with all microsoft updates installed) with Exchange 2013 SP1 standalone server. Is this a Outlook or Exchange issue and how can I resolve this?
    Thnx Remco

    Hi Remco,
    Please also try to start Outlook in safe mode and test again to check if this issue continues. To start Outlook in safe mode, press Windows key + R to open the Run command, type
    outlook /safe and press Enter.
    If problem continues in Outlook safe mode, please try creating a new mail profile and reconfigure your email account, then creating a .oft template to test this issue again. For your convenience:
    http://office.microsoft.com/en-in/outlook-help/create-an-outlook-profile-HA102749460.aspx
    Please let me know the result.
    Regards,
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • OIM - Send email to approver not working

    Hi,
    I have to send a notification email to approver when the approval task goes in pending status. I think I have done all that is required however the mail is to being sent. Please let me know where I might be wrong.
    I Created an email Defintion of type request. My task name is "Manager approval" and all it does is "request target users manager". So I go to notification tab, set the status as "P" and tick the "assignee" check box (i.e. the approver). The approver is present in OIM and his email "user def" field has a valid email adress (my test adress). I have also created a IT resource of type "mail server" and set server name, user login and password (all my test details). I havent set anything in authentication though. Dont know if that could be the problem.
    The task is now in pending status but no mail is sent. Nothing is logged in jboss logs as well. Please lemme know if I am missing something.
    Thanks, M

    Hi,
    The language and region are same as in system config. I tried sending the mail from the assignment tab and it gives me a error. "cannot send - MAIL requires AUTH". The mail server i am using requires authentication. Looks like I need a open mail server to be able to send mail through OIM. When I defined a IT resource of type "Mail Server", it has one tab of the type "Authentication", which is just one text box. What needs to be filled in here? For my mail server it says, 'authentication required, and use same credentials as the incoming server'.
    Please let me know what needs to be defined in this 'authentication' text box and what needs to be done if a open mail server is not available.
    Thanks, M

  • Is there any problem to use multiple threads to send email with JavaMail

    Dear all,
    I am using JavaMail 1.3.2 to send emails with SMTP, it works very well for a long time.
    But one day, I found that the email service hanged and I could never send email again until I restart the tomcat. I found that the reason was a deadlock had been created, the required resource for sending email had not been released.
    I guess the error is due to multiple threads are sending email at the same time. I made a test to create seperate thread for sending each email. After few days, I found this deadlock happened again. So, my question is: Can I use JavaMail with multiple threads? If not, I may need to sychronized all the thread that using JavaMail. I would like to make sure this is the reason for causing the deadlock problem.
    Here is part of my code for using JavaMail:
    transport = session.getTransport("smtp");
    transport.connect(email_host, smtp_user, smtp_pass);
    message.saveChanges();
    transport.sendMessage(message,message.getAllRecipients());
    which is very standard call, and it worked well for a long time.
    Here is part for my thread dump on tomcat:
    (Thread-339)
    - waiting to lock <0x5447c180> (a sun.nio.cs.StandardCharsets)
    (Thread-342)
    - locked <0x5447c180> (a sun.nio.cs.StandardCharsets)
    It seems that these happened after call the method transport.sendMessage() or message.updateChanges()
    , and the underlying implementation may require the JRE StandardCharsets object. But the object had been locked and never be released. So, the sendMessage() or updateChanges() can't be completed.
    Please give me some helps if you have any idea about it.
    Thanks very much!
    Sirius

    Note that the Nightly build gets updated daily (and sometimes more than once in case of a respin) and it is always possible that something goes wrong and it doesn't work properly, so be prepared for issues if you decide to stay with the Nightly build and make sure to have the current release with its own profile installed as well in case of problems.
    See also:
    * http://kb.mozillazine.org/Testing_pre-release_versions
    *http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
    *http://kb.mozillazine.org/Shortcut_to_a_specific_profile
    *http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox

  • TS3276 My o2 email account does not work when sending from my MAC it will accept incoming mail but not send it gives me a message that  o2 account (offline) my mac I have no problem with my iPhone  or mac laptop. any suggestions please.

    My o2 email account does not work when sending from my MAC it will accept incoming mail but not send it gives me a message that  o2 account (offline) my mac I have no problem with my iPhone  or mac laptop. any suggestions please.

    Sorry for the delay...
    I did what you've told me, new account and manually copied my files from Time Machine. I had lots of permissions problems, but at the end, almost everything is in order... It seems it had to be with some of the Apple Preferences, but I can't be sure, as most of them were dumped to the trash can.
    I still don't have my Mail Rules back, unfortunately, although I did goggled some. It is a pity, as I had around 30 or 40 of them, getting my mail in order to each of its mailboxes, but it is a small price as the rest doesn't show the before syntoms.
    Thanks for the help, anyway!!

  • TS3899 Cannot send email with new iPad air.  Works fine with old iPad and iPhone.

    Cannot send email with new iPad air.  Works fine with old iPad and iPhone.  I have deleted account and reinstalled.

    Thanks.  I got the problem fixed.  Spent time with the Apple folks and was kicked up to a senior advisor.  It seems the problem was with my internet provider - Tmie Warner.  Remember I could use the old ipad and the iphone to send mail.  I checked all the specifics between the three units.  It seems that TW is changing over from the RR.com  to TWC.com.  Since the new ipad air was just set up, it fell under the new TWC mail specifics. 

  • I'm not able to send emails with mail.ru. Receiving and reading is not a problem. When I create a email with mail.ru its not possible to send it although its stored in my mail.ru account as "still to be send". What can it be??

    I'm not able to send emails with mail.ru. Receiving is not a problem. Creating a mail is also not a problem and the mail will be stored at mail.ru as still to be send, only problem is its not possible to send. I noticed the buttons for sending change colour when used but they don't perform. What it is?

    Don't know what changed, but all of a sudden able to send emails by mail.ru ...... sorry for bothering.

  • I can receive but not send emails with my skynet account - what am I doing wrong ?

    I can receive but not send emails with my skynet account - what am I doing wrong ?
    I have no problems with my Yahoo account but I can not send emails with my skynet account.
    Actually in iPhone :
    Outgoing Mail Server > SMTP "relay.skynet.be"
    Primary server > Not Configured > Off
    Thank you ...

    When you set them up, did you set up both the incoming and outgoing email servers separately, and did you enter the correct SMTP server name, and enter your userid and password even though it says "optional"?
    Something else to try, if you haven't, is delete the accounts, connect the iPhone to iTunes, on the Info tab check the box to sync mail server settings, then sync. This should duplicate the settings from your computer to your iPhone.

  • Reply address: is it possible to use another reply address other than the pop address used in my account. I have a special work account and would like to send emails with that address as my reply address...or sent from address

    Reply address: is it possible to use another reply address other than the pop address used in my account. I have a special work account and would like to send emails with that address as my reply address...or sent from address

    i found out how to do this finally!
    1) set up google gmail account to forward your emails to (from the [email protected])
    2) go to your gmail account
    3) go to settings (cog in right hand corner)
    4) go to 'accounts and import'
    5) go to 'send mail as'
    6) click 'Add another email address you own' - add your [email protected] address
    7) google will send a verification email with code to that email address.
    8) enter code
    9) go back to gmail account  >'send mail as' and select 'make default'
    10) close mac 'mail' program and reopen it.
    as long as you have gmail account selected as the primary account in MAIL - mail will now come throught as being sent from that  [email protected] address!!

Maybe you are looking for

  • New to Mac

    Hi, I just bought my first Mac, it's a MacBook with OS 10.5.6. I have a cable internet connection with a Modem, and I have been able to receive email, ping shows an IP address, diagnostics says there's no problem with my internet connection, but MAIL

  • Back to my mac failing after upgrade to 10.10

    Hey guys, I upgraded my home iMac and home MBP at the same time to 10.10.  All went smoothly.  When out of town, my MBP can still see my iMac for Back to my Mac use.  I upgraded my work iMac, which has always been able to see my home iMac, to 10.10 a

  • OIM DB Application Table (for oracle 10g db) reconciliation problem

    I want to reconcile my oracle database table into OIM. My table name in the db is called SD_EMPLOYEE and following is the fields.      StaffID VARCHAR2(10),      EmpID VARCHAR2(6),      IDType VARCHAR2(20),      IDNum VARCHAR2(20),      EmpName VARCH

  • Why are Apple OS X 10.6 user-developed services not available in Firefox 3.6.

    I have written an OS X 10.6 Apple script Service that processes text on a web page. This Service is available in Safari through either a right-click or through the use of the Services menu but does not show when I'm using Firefox 3.6. How can I get t

  • Where to download WebLogic Portal 10.3.0

    I need the download link for WebLogic Portal 10.3.0. Is there anyone who can help me ASAP? Edited by: user13540642 on Apr 4, 2012 11:19 PM