Valnurat 3 Posted February 9 Share Posted February 9 Hi I have been looking at the _INetSmtpMail example and I got it to work, but I have a question regarding that I would like to send a url link and use different font size. Is this possible to do with this function? If not what should I use instead? Yours sincerely Kenneth. Link to post Share on other sites
Trong 108 Posted February 9 Share Posted February 9 Use HTML! Regards, Link to post Share on other sites
Valnurat 3 Posted February 9 Author Share Posted February 9 How do I do that? Yours sincerely Kenneth. Link to post Share on other sites
Zedna 377 Posted February 9 Share Posted February 9 use HTMLBody instead of TextBody: $objMessage = ObjCreate ("CDO.Message") ... ;$objMessage.Textbody = $Text $objMessage.HTMLBody = $Text ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to post Share on other sites
Valnurat 3 Posted February 10 Author Share Posted February 10 I'm sorry, but I don't know how to use that with the Autoit example: #include <Inet.au3> #include <MsgBoxConstants.au3> Local $s_SmtpServer = "mysmtpserver.com.au" Local $s_FromName = "My Name" Local $s_FromAddress = "From eMail Address" Local $s_ToAddress = "To eMail Address" Local $s_Subject = "My Test UDF" Local $as_Body[2] $as_Body[0] = "Testing the new email udf" $as_Body[1] = "Second Line" Local $iResponse = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ComputerName, -1) Local $iErr = @error If $iResponse = 1 Then MsgBox($MB_SYSTEMMODAL, "Success!", "Mail sent") Else MsgBox($MB_SYSTEMMODAL, "Error!", "Mail failed with error code " & $iErr) EndIf 😳 Yours sincerely Kenneth. Link to post Share on other sites
Trong 108 Posted February 10 Share Posted February 10 _INetSmtpMail() not support! Use UDF : Regards, Link to post Share on other sites
Valnurat 3 Posted February 10 Author Share Posted February 10 Ok. How do you build up the body if I want to send several lines? And is it my native mail program that will be used? Yours sincerely Kenneth. Link to post Share on other sites
Dan_555 132 Posted February 10 Share Posted February 10 (edited) $as_Body[2] is an array and therefore to add lines in your pasted example : Local $as_Body[2] $as_Body[0] = "Testing the new email udf" $as_Body[1] = "Second Line" change the 2 into amount of lines ... eg 4 then $as_Body[2] = "Third Line" $as_Body[3] = "Fourth Line" Edited February 10 by Dan_555 Some of my script sourcecode Link to post Share on other sites
Valnurat 3 Posted February 13 Author Share Posted February 13 Yes, but the UDF Mr. Trong linked to, does not seems to be an array. $as_Body can't send HTML and Mr. Trong linked to the UDF that can send HTML. Yours sincerely Kenneth. Link to post Share on other sites
water 2,720 Posted February 13 Share Posted February 13 Then use the UDF by Jos (linked to by Trong). Create a string out of the array uisng _ArraytoString. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to post Share on other sites
Valnurat 3 Posted February 13 Author Share Posted February 13 I'm in progress of that. I haven't yet started to use the array, so I don't think I need to use _ArrayToString. Local $Body = "<h2>Dear " & $sUsername & "</h2><br>" & _ "<a href=""https://company.service-now.com/sp?id=sc_category&sys_id=7d46b111db5503004d30f7871d9619be&catalog_id=-1&spa=1"">IT Support</a>" But this is what I have done. Yours sincerely Kenneth. Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now